home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / kms20src.lha / KMSC / commands.c < prev    next >
C/C++ Source or Header  |  1995-09-23  |  75KB  |  2,787 lines

  1. /**********************************
  2.  *              KMS               *
  3.  **********************************
  4.  *  ©1992 by BlackMagic Software  *
  5.  **********************************
  6.  *                                *
  7.  **********************************/
  8.  
  9. #include <KMS/KMS.h>
  10.  
  11. Prototype VOID Cmd_QMARK(VOID);
  12. Prototype VOID Cmd_HILFE(VOID);
  13. Prototype VOID Cmd_BRETT(VOID);
  14. Prototype VOID Cmd_INHALT(VOID);
  15. Prototype VOID Cmd_LESEN(VOID);
  16. Prototype VOID Cmd_SCHREIBEN(VOID);
  17. Prototype VOID Cmd_ANTWORT(VOID);
  18. Prototype VOID Cmd_SHUTDOWN(VOID);
  19. Prototype VOID Cmd_UMSINFO(VOID);
  20. Prototype VOID Cmd_HISTORY(VOID);
  21. Prototype VOID Cmd_UMSDIR(VOID);
  22. Prototype VOID Cmd_AEDIT(VOID);
  23. Prototype VOID Cmd_UMSEXPIRE(VOID);
  24. Prototype VOID Cmd_USERPREFS(VOID);
  25. Prototype VOID Cmd_TEMPPREFS(VOID);
  26. Prototype VOID Cmd_PASSWORD(VOID);
  27. Prototype VOID Cmd_DELETE(VOID);
  28. Prototype VOID Cmd_DELPROT(VOID);
  29. Prototype VOID Cmd_SELECT(VOID);
  30. Prototype VOID Cmd_HIDE(VOID);
  31. Prototype VOID Cmd_PORTLIST(VOID);
  32. Prototype VOID Cmd_KMSREXX(UWORD);
  33. Prototype VOID Cmd_KMSBATCH(VOID);
  34. Prototype VOID Cmd_ECHO(VOID);
  35. Prototype VOID Cmd_LABERFILTER(VOID);
  36. Prototype VOID Cmd_VORMERKER(VOID);
  37. Prototype VOID Cmd_UEDIT(VOID);
  38. Prototype VOID Cmd_UDIR(VOID);
  39. Prototype VOID Cmd_PEDIT(VOID);
  40. Prototype VOID Cmd_PDELETE(VOID);
  41. Prototype VOID Cmd_PDIR(VOID);
  42. Prototype VOID Cmd_PUPLOAD(VOID);
  43. Prototype VOID Cmd_PDOWNLOAD(VOID);
  44. Prototype VOID Cmd_SIGEDIT(VOID);
  45. Prototype VOID Cmd_INFO(VOID);
  46. Prototype VOID Cmd_ALIAS(VOID);
  47. Prototype VOID Cmd_LOG(VOID);
  48. Prototype VOID Cmd_ACLEDIT(VOID);
  49. Prototype VOID Cmd_SYSMSG(VOID);
  50. Prototype VOID Cmd_REREAD(VOID);
  51. Prototype VOID Cmd_BITED(VOID);
  52. Prototype VOID Cmd_UPLOAD(VOID);
  53. Prototype VOID Cmd_DOWNLOAD(VOID);
  54. Prototype VOID Cmd_SCHREIBMODUS(VOID);
  55. Prototype VOID Cmd_EXEC(VOID);
  56. Prototype VOID Cmd_PAUSE(VOID);
  57. Prototype VOID Cmd_CHAT(VOID);
  58.  
  59. /*****************************
  60.  * Externe Globale Variablen *
  61.  *****************************/
  62.  
  63. extern struct KMSBase *KMSBase;
  64. extern struct LocalConfig *KMS_LC;
  65.  
  66. extern UBYTE ShutDown;
  67.  
  68. extern UBYTE CmdArgC;
  69. extern STRPTR CmdArgV[];
  70.  
  71. extern UMSAccount MyUMSAccount, SysUMSAccount;
  72.  
  73. extern UMSMsgNum Lastmsg;
  74.  
  75. extern STRPTR PPArg, PPArg2;
  76.  
  77. extern TEXT PathString[LEN_KMSPATH+1];
  78.  
  79. extern BPTR OldInput;
  80.  
  81. extern struct UserNode MerkUser;
  82.  
  83. /*********************
  84.  * Globale Variablen *
  85.  *********************/
  86.  
  87. /***************************************
  88.  * Befehl: ?                           *
  89.  ***************************************
  90.  * I: ---                              *
  91.  * O: ---                              *
  92.  ***************************************/
  93.  
  94. /// "Cmd_QMARK"
  95.  
  96. VOID Cmd_QMARK(VOID)
  97.    {
  98.    struct CommandNode *cpoint;
  99.    UBYTE result = 0, count = 0;
  100.    TEXT cmdname[LEN_COMMAND*2+1];
  101.    TEXT output[LEN_PARSEOUT+1];
  102.  
  103.    SysMsg(TITLE_CMDLIST);
  104.  
  105.    cpoint = (struct CommandNode *)KMSBase->CommandList.mlh_Head;
  106.    while(cpoint->Node.mln_Succ && !result)
  107.       {
  108.       if ((cpoint->Level >= 0 && cpoint->Level <= KMS_LC->Session.CurrentUser->UserData.Level)
  109.          || (cpoint->Level < 0 && -cpoint->Level == KMS_LC->Session.CurrentUser->UserData.Level))
  110.          {
  111.          strcpy(cmdname, cpoint->DisplayName);
  112.  
  113.          StdStringParse(cmdname, output, LEN_PARSEOUT);
  114.  
  115.          if (count == 4)
  116.             if (output[strlen(output)-1] == '\t')
  117.                output[strlen(output)-1] = '\0';
  118.  
  119.          result = Print(output, PF_CTRLX|PF_NOLF);
  120.          count++;
  121.          }
  122.       if (count == 5)
  123.          {
  124.          Print(NULL, 0);
  125.          count = 0;
  126.          }
  127.       cpoint = (struct CommandNode *)cpoint->Node.mln_Succ;
  128.       }
  129.    if (count)
  130.       Print(NULL, 0);
  131.  
  132.    Print(NULL, 0);
  133.    }
  134.  
  135. ///
  136.  
  137. /***************************************
  138.  * Befehl: HILFE                       *
  139.  ***************************************
  140.  * I: ---                              *
  141.  * O: ---                              *
  142.  ***************************************/
  143.  
  144. /// "Cmd_HILFE"
  145.  
  146. VOID Cmd_HILFE(VOID)
  147.    {
  148.    TEXT buff[32];
  149.  
  150.    if (CmdArgC == 1)
  151.       {
  152.       /* "HILFE" -> Allgemeine Hilfe */
  153.  
  154.       SendFile("KMS_HELP_0", SF_CHOOSEEXT);
  155.       }
  156.    else if (CmdArgC == 2)
  157.       {
  158.       /* "HILFE befehl" -> Spezielle Hilfe */
  159.  
  160.       UWORD cid = CmdSearch(CmdArgV[1]);
  161.       if (cid)
  162.          {
  163.          sprintf(buff, "KMS_HELP_%d",cid);
  164.          SendFile(buff, SF_CHOOSEEXT);
  165.          }
  166.       else
  167.          SysMsg(NO_HELP);
  168.       }
  169.    else
  170.       {
  171.       SysMsg(TOO_MANY_PARAMS);
  172.       }
  173.    }
  174.  
  175. ///
  176.  
  177. /***************************************
  178.  * Befehl: BRETT                       *
  179.  ***************************************
  180.  * I: ---                              *
  181.  * O: ---                              *
  182.  ***************************************/
  183.  
  184. /// "Cmd_BRETT"
  185.  
  186. VOID Cmd_BRETT(VOID)
  187.    {
  188.    UMSMsgNum num;
  189.    struct AreaNode *currarea = NULL;
  190.    TEXT all[LEN_NUMBER+1];
  191.    TEXT new[LEN_NUMBER+1];
  192.  
  193.    if (CmdArgC == 1)
  194.       {
  195.       /* "BRETT" -> Info aktuelles Brett */
  196.  
  197.       SelectArea(KMS_LC->Session.CurrentArea->AreaData.MBName);
  198.  
  199.       num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
  200.                                       UMSTAG_SelMask,      KMSLSTATF_InGroup,
  201.                                       UMSTAG_SelMatch,     KMSLSTATF_InGroup,
  202.                                       TAG_DONE);
  203.       sprintf(all, "%ld", num);
  204.       PPArg = all;
  205.       num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
  206.                                       UMSTAG_SelMask,      KMSLSTATF_Unread|KMSLSTATF_InGroup,
  207.                                       UMSTAG_SelMatch,     KMSLSTATF_Unread|KMSLSTATF_InGroup,
  208.                                       TAG_DONE);
  209.       sprintf(new, "%ld", num);
  210.       PPArg2 = new;
  211.       SysMsg(DIRLST_ACT);
  212.       PPArg2 = NULL;
  213.       PPArg = NULL;
  214.       
  215.       SysMsg(DIRLST_HEAD);
  216.  
  217.       PrintAreaInfo(KMS_LC->Session.CurrentArea, KMS_LC->Session.CurrentAccess);
  218.       }
  219.    else if (CmdArgC == 2)
  220.       {
  221.       /* Parameter 1 auswerten */
  222.  
  223.       if (CmpArg(1, "+!") || CmpArg(1, "#"))
  224.          {
  225.          /* "BRETT +!" -> Wechsel in nächstes Brett mit neuen Nachrichten */
  226.  
  227.          ReadMsg(0, RF_RESET);
  228.          ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTNEW);
  229.          }
  230.       else if (CmpArg(1, "+"))
  231.          {
  232.          /* "BRETT +" -> Wechsel in naechstes Brett */
  233.  
  234.          currarea = KMS_LC->Session.CurrentArea;
  235.  
  236.          ReadMsg(0, RF_RESET);
  237.          ListAreas(NULL, ALIST_WHOLE|ALIST_NEXT);
  238.  
  239.          if (KMS_LC->Session.CurrentUser->UserData.Flags & UF_AUTO_AREALIST)
  240.             if (currarea != KMS_LC->Session.CurrentArea)
  241.                ListAreas(NULL, ALIST_ALL);
  242.          }
  243.       else if (CmpArg(1, "+%") || CmpArg(1, "+@"))
  244.          {
  245.          /* "BRETT +%" -> Wechsel in nächstes Brett mit selekt. Nachrichten */
  246.  
  247.          ReadMsg(0, RF_RESET);
  248.          ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTSEL);
  249.          }
  250.       else if (CmpArg(1, "!"))
  251.          {
  252.          /* "BRETT !" -> Bretter mit neuen Nachrichten ab aktuellem */
  253.  
  254.          ListAreas(NULL, ALIST_NEW);
  255.          }
  256.       else if (CmpArg(1, "*"))
  257.          {
  258.          /* "BRETT *" -> Alle Bretter ab aktuellem */
  259.  
  260.          ListAreas(NULL, ALIST_ALL);
  261.          }
  262.       else if (CmpArg(1, "%") || CmpArg(1, "@"))
  263.          {
  264.          /* "BRETT %" -> Alle Bretter mit selekt. Nachrichten ab aktuellem */
  265.  
  266.          ListAreas(NULL, ALIST_SEL);
  267.          }
  268.       else if (CmpArg(1, "!!"))
  269.          {
  270.          /* "BRETT !!" -> Bretter mit neuen ab aktuellem / Alle Ebenen */
  271.  
  272.          ListAreas(NULL, ALIST_NEW|ALIST_WHOLE);
  273.          }
  274.       else if (CmpArg(1, "**"))
  275.          {
  276.          /* "BRETT **" -> Alle Bretter ab aktuellem / Alle Ebenen */
  277.  
  278.          ListAreas(NULL, ALIST_ALL|ALIST_WHOLE);
  279.          }
  280.       else if (CmpArg(1, "%%") || CmpArg(1, "@@"))
  281.          {
  282.          /* "BRETT %%" -> Bretter mit selektierten ab aktuellem / Alle Ebenen */
  283.  
  284.          ListAreas(NULL, ALIST_SEL|ALIST_WHOLE);
  285.          }
  286.       else
  287.          {
  288.          /* "BRETT pfad" -> Brettwechsel gemäß Pfadangabe */
  289.  
  290.          if(!ChangePath(CmdArgV[1]))
  291.             SysMsg(INVALID_PATH);
  292.          }
  293.       }
  294.    else if (CmdArgC == 3)
  295.       {
  296.       /* Parameter 1 und 2 auswerten */
  297.  
  298.       if (CmpArg(2, "+!") || CmpArg(2, "#"))
  299.          {
  300.          /* "BRETT pfad +!" -> Wechsel in nächstes Brett mit neuen Nachrichten ab pfad */
  301.  
  302.          ReadMsg(0, RF_RESET);
  303.          ListAreas(CmdArgV[1], ALIST_WHOLE|ALIST_NEXTNEW);
  304.          }
  305.       else if (CmpArg(2, "+"))
  306.          {
  307.          /* "BRETT pfad +" -> Wechsel in naechstes Brett ab pfad */
  308.  
  309.          ReadMsg(0, RF_RESET);
  310.          ListAreas(CmdArgV[1], ALIST_WHOLE|ALIST_NEXT);
  311.          }
  312.       else if (CmpArg(2, "+%") || CmpArg(2, "+@"))
  313.          {
  314.          /* "BRETT pfad +%" -> Wechsel in naechstes Brett ab pfad mit selekt. Nachrichten */
  315.  
  316.          ReadMsg(0, RF_RESET);
  317.          ListAreas(CmdArgV[1], ALIST_WHOLE|ALIST_NEXTSEL);
  318.          }
  319.       else if (CmpArg(2, "!"))
  320.          {
  321.          /* "BRETT pfad !" -> Bretter mit neuen Nachrichten ab pfad */
  322.  
  323.          ListAreas(CmdArgV[1], ALIST_NEW);
  324.          }
  325.       else if (CmpArg(2, "*"))
  326.          {
  327.          /* "BRETT pfad *" -> Alle Bretter ab pfad */
  328.  
  329.          ListAreas(CmdArgV[1], ALIST_ALL);
  330.          }
  331.       else if (CmpArg(2, "%") || CmpArg(2, "@"))
  332.          {
  333.          /* "BRETT pfad %" -> Alle Bretter mit selekt. Nachr. ab pfad */
  334.  
  335.          ListAreas(CmdArgV[1], ALIST_SEL);
  336.          }
  337.       else if (CmpArg(2, "!!"))
  338.          {
  339.          /* "BRETT pfad !!" -> Bretter mit neuen ab pfad / Alle Ebenen */
  340.  
  341.          ListAreas(CmdArgV[1], ALIST_NEW|ALIST_WHOLE);
  342.          }
  343.       else if (CmpArg(2, "**"))
  344.          {
  345.          /* "BRETT pfad **" -> Alle Bretter ab pfad / Alle Ebenen */
  346.  
  347.          ListAreas(CmdArgV[1], ALIST_ALL|ALIST_WHOLE);
  348.          }
  349.       else if (CmpArg(2, "%%") || CmpArg(2, "@@"))
  350.          {
  351.          /* "BRETT pfad %%" -> Alle Bretter mit selekt. Nachr. ab pfad / Alle Ebenen */
  352.  
  353.          ListAreas(CmdArgV[1], ALIST_SEL|ALIST_WHOLE);
  354.          }
  355.       else
  356.          SysMsg(INVALID_PARAMS);
  357.       }
  358.    else
  359.       SysMsg(TOO_MANY_PARAMS);
  360.    }
  361.  
  362. ///
  363.  
  364. /***************************************
  365.  * Befehl: INHALT                      *
  366.  ***************************************
  367.  * I: ---                              *
  368.  * O: ---                              *
  369.  ***************************************/
  370.  
  371. /// "Cmd_INHALT"
  372.  
  373. VOID Cmd_INHALT(VOID)
  374.    {
  375.    if (!(KMS_LC->Session.CurrentAccess & AACC_READ))
  376.       {
  377.       PPArg = KMS_LC->Session.InputBuffer;
  378.       SysMsg(NO_READ_ACCESS);
  379.       PPArg = NULL;
  380.       return;
  381.       }
  382.  
  383.    if (CmdArgC == 1)
  384.       ListMsgs(KMS_LC->Session.CurrentArea, MLIST_NEW);
  385.    else if (CmdArgC == 2)
  386.       {
  387.       if (CmpArg(1, ">"))
  388.          ListMsgs(KMS_LC->Session.CurrentArea, MLIST_ALL|MLIST_CURR);
  389.       else if (CmpArg(1, ">!"))
  390.          ListMsgs(KMS_LC->Session.CurrentArea, MLIST_NEW|MLIST_CURR);
  391.       else if (CmpArg(1, "*"))
  392.          ListMsgs(KMS_LC->Session.CurrentArea, MLIST_ALL);
  393.       else if (CmpArg(1, "%") || CmpArg(1, "@"))
  394.          ListMsgs(KMS_LC->Session.CurrentArea, MLIST_SEL);
  395.       else if (CmpArg(1, "P"))
  396.          ListMsgs(KMS_LC->Session.CurrentArea, MLIST_PROT);
  397.       else if (CmpArg(1, "*!"))
  398.          {
  399.          ULONG temp = KMS_LC->Session.CurrentUser->UserData.Flags;
  400.  
  401.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_AUTO_LIST;
  402.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EMU_ANSI;
  403.  
  404.          while(ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTNEW|ALIST_QUIET))
  405.             {
  406.             ReadMsg(0, RF_RESET);
  407.  
  408.             MsgPrint("\n", 0);
  409.  
  410.             if (ListMsgs(KMS_LC->Session.CurrentArea, MLIST_NEW|MLIST_QUIET))
  411.                break;
  412.  
  413.             MsgPrint("\n", 0);
  414.             }
  415.  
  416.          KMS_LC->Session.CurrentUser->UserData.Flags = temp;
  417.          }
  418.       else if (CmpArg(1, "**"))
  419.          {
  420.          ULONG temp = KMS_LC->Session.CurrentUser->UserData.Flags;
  421.  
  422.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_AUTO_LIST;
  423.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EMU_ANSI;
  424.  
  425.          while(ListAreas(NULL, ALIST_WHOLE|ALIST_NEXT|ALIST_QUIET))
  426.             {
  427.             ReadMsg(0, RF_RESET);
  428.  
  429.             MsgPrint("\n", 0);
  430.  
  431.             if (ListMsgs(KMS_LC->Session.CurrentArea, MLIST_ALL|MLIST_QUIET))
  432.                break;
  433.  
  434.             MsgPrint("\n", 0);
  435.             }
  436.  
  437.          KMS_LC->Session.CurrentUser->UserData.Flags = temp;
  438.          }
  439.       else if (CmpArg(1, "*%") || CmpArg(1, "*@"))
  440.          {
  441.          ULONG temp = KMS_LC->Session.CurrentUser->UserData.Flags;
  442.  
  443.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_AUTO_LIST;
  444.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EMU_ANSI;
  445.  
  446.          while(ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTSEL|ALIST_QUIET))
  447.             {
  448.             ReadMsg(0, RF_RESET);
  449.  
  450.             MsgPrint("\n", 0);
  451.  
  452.             if (ListMsgs(KMS_LC->Session.CurrentArea, MLIST_SEL|MLIST_QUIET))
  453.                break;
  454.  
  455.             MsgPrint("\n", 0);
  456.             }
  457.  
  458.          KMS_LC->Session.CurrentUser->UserData.Flags = temp;
  459.          }
  460.       else if (CmpArg(1, "*P"))
  461.          {
  462.          ULONG temp = KMS_LC->Session.CurrentUser->UserData.Flags;
  463.  
  464.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_AUTO_LIST;
  465.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EMU_ANSI;
  466.  
  467.          while(ListAreas(NULL, ALIST_WHOLE|ALIST_NEXTPROT|ALIST_QUIET))
  468.             {
  469.             ReadMsg(0, RF_RESET);
  470.  
  471.             MsgPrint("\n", 0);
  472.  
  473.             if (ListMsgs(KMS_LC->Session.CurrentArea, MLIST_PROT|MLIST_QUIET))
  474.                break;
  475.  
  476.             MsgPrint("\n", 0);
  477.             }
  478.  
  479.          KMS_LC->Session.CurrentUser->UserData.Flags = temp;
  480.          }
  481.       else if(ParseRange(CmdArgV[1]))
  482.          ListMsgs(KMS_LC->Session.CurrentArea, MLIST_RANGE);
  483.       else
  484.          SysMsg(INVALID_PARAMS);
  485.       }
  486.    else
  487.       SysMsg(TOO_MANY_PARAMS);
  488.    }
  489.  
  490. ///
  491.  
  492. /***************************************
  493.  * Befehl: LESEN                       *
  494.  ***************************************
  495.  * I: ---                              *
  496.  * O: ---                              *
  497.  ***************************************/
  498.  
  499. /// "Cmd_LESEN"
  500.  
  501. VOID Cmd_LESEN(VOID)
  502.    {
  503.    if (!(KMS_LC->Session.CurrentAccess & AACC_READ))
  504.       {
  505.       PPArg = KMS_LC->Session.InputBuffer;
  506.       SysMsg(NO_READ_ACCESS);
  507.       PPArg = NULL;
  508.       return;
  509.       }
  510.  
  511.    KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_RMODE_RANGE;
  512.  
  513.    if (CmdArgC == 1)
  514.       {
  515.       /* "LESEN" -> Nächste neue Nachricht in aktueller Gruppe lesen */
  516.  
  517.       ReadMsg(0, RF_NEW);
  518.       }
  519.    else if (CmdArgC == 2)
  520.       {
  521.       if (CmpArg(1, "+"))
  522.          ReadMsg(0,RF_NEXT);
  523.       else if (CmpArg(1, "-"))
  524.          ReadMsg(0,RF_PREV);
  525.       else if (CmpArg(1, "["))
  526.          ReadMsg(0,RF_FIRST);
  527.       else if (CmpArg(1, "]"))
  528.          ReadMsg(0,RF_LAST);
  529.       else if (CmpArg(1, "="))
  530.          ReadMsg(0,RF_SAME);
  531.       else if (CmpArg(1, "/"))
  532.          ReadMsg(0,RF_NREPLY);
  533.       else if (CmpArg(1, "\\"))
  534.          ReadMsg(0,RF_PREPLY);
  535.       else if (CmpArg(1, "^"))
  536.          ReadMsg(0,RF_PARENT);
  537.       else if (CmpArg(1, ">"))
  538.          ReadMsg(0,RF_RIGHT);
  539.       else if (CmpArg(1, "<"))
  540.          ReadMsg(0,RF_LEFT);
  541.       else if (CmpArg(1, "V"))
  542.          ReadMsg(0,RF_DOWN);
  543.       else if (CmpArg(1, "!"))
  544.          ReadMsg(0,RF_ROOT);
  545.       else if (CmpArg(1, "$"))
  546.          ReadMsg(0,RF_CONT);
  547.       else if (CmpArg(1, "%") || CmpArg(1, "@"))
  548.          ReadMsg(0,RF_SEL);
  549.       else if (CmpArg(1, "("))
  550.          ReadMsg(0,RF_PRVSEL);
  551.       else if (CmpArg(1, ")"))
  552.          ReadMsg(0,RF_NXTSEL);
  553.       else if (CmpArg(1, "&"))
  554.          ReadMsg(0,RF_SAME|RF_VERBOSE);
  555.       else if (CmpArg(1, "ROT13"))
  556.          ReadMsg(0,RF_SAME|RF_ROT13);
  557.       else if (ParseRange(CmdArgV[1]))
  558.          {
  559.          UMSSelectTags(MyUMSAccount,
  560.                        UMSTAG_SelWriteLocal, TRUE,
  561.                        UMSTAG_SelUnset,      KMSLSTATF_ReadRange,
  562.                        TAG_DONE);
  563.  
  564.          UMSSelectTags(MyUMSAccount,
  565.                        UMSTAG_SelReadLocal,  TRUE,
  566.                        UMSTAG_SelWriteLocal, TRUE,
  567.                        UMSTAG_SelMask,       KMSLSTATF_InRange,
  568.                        UMSTAG_SelMatch,      KMSLSTATF_InRange,
  569.                        UMSTAG_SelSet,        KMSLSTATF_ReadRange,
  570.                        TAG_DONE);
  571.  
  572.          ReadMsg(0, RF_RESET);
  573.  
  574.          KMS_LC->Session.CurrentUser->UserData.Flags |= UF_RMODE_RANGE;
  575.  
  576.          ReadMsg(0, RF_RANGE);
  577.          }
  578.       else
  579.          SysMsg(INVALID_PARAMS);
  580.       }
  581.    else
  582.       SysMsg(TOO_MANY_PARAMS);
  583.    }
  584.  
  585. ///
  586.  
  587. /***************************************
  588.  * Befehl: SCHREIBEN                   *
  589.  ***************************************
  590.  * I: ---                              *
  591.  * O: ---                              *
  592.  ***************************************/
  593.  
  594. /// "Cmd_SCHREIBEN"
  595.  
  596. VOID Cmd_SCHREIBEN(VOID)
  597.    {
  598.    if (KMS_LC->Session.CurrentArea->AreaData.Type & ATYPE_FILES)
  599.       {
  600.       SysMsg(NOT_IN_FILEAREA);
  601.       return;
  602.       }
  603.  
  604.    if (CmdArgC == 1)
  605.       {
  606.       /* Neue Nachricht in aktueller Gruppe schreiben */
  607.  
  608.       WriteMsg(WF_NEW, NULL, NULL, NULL);
  609.       }
  610.    else if (CmdArgC == 2)
  611.       {
  612.       if (CmpArg(1, "="))
  613.          {
  614.          /* Nachricht edieren */
  615.  
  616.          if (!Lastmsg)
  617.             SysMsg(NO_MSG_READ);
  618.          else
  619.             if (WriteMsg(WF_EDIT, NULL, NULL, NULL))
  620.                if (YNRequest(QUERY_DELETE_SOURCE, TRUE))
  621.                   DeleteMsg(NULL, DEL_CURRENT);
  622.          }
  623.       else if (CmpArg(1, "=="))
  624.          {
  625.          /* Nachricht nochmal schicken */
  626.  
  627.          if (!Lastmsg)
  628.             SysMsg(NO_MSG_READ);
  629.          else
  630.             if (WriteMsg(WF_RESEND, NULL, NULL, NULL))
  631.                if (YNRequest(QUERY_DELETE_SOURCE, TRUE))
  632.                   DeleteMsg(NULL, DEL_CURRENT);
  633.          }
  634.       else if (CmpArg(1, "!"))
  635.          {
  636.          /* Persoenliche Nachricht von jedem Brett aus */
  637.  
  638.          WriteMsg(WF_NEW|WF_PRIV, NULL, NULL, NULL);
  639.          }
  640.       else if (CmpArg(1, ">"))
  641.          {
  642.          /* Weiterleiten in gleichem Brett an evt. anderen Empfänger */
  643.  
  644.          if (!Lastmsg)
  645.             SysMsg(NO_MSG_READ);
  646.          else
  647.             WriteMsg(WF_FORWARD, KMS_LC->Session.CurrentArea, NULL, NULL);
  648.          }
  649.       else if (CmpArg(1, "<"))
  650.          {
  651.          /* Neue Nachricht per Upload */
  652.  
  653.          WriteMsg(WF_NEW, NULL, "", NULL);
  654.          }
  655.       else if (CmpArg(1, "ROT13"))
  656.          {
  657.          /* Neue Nachricht in aktueller Gruppe, ROT-13 kodiert */
  658.  
  659.          WriteMsg(WF_NEW|WF_ROT13, NULL, NULL, NULL);
  660.          }
  661.       else
  662.          WriteMsg(WF_NEW, NULL, NULL, CmdArgV[1]);
  663.       }
  664.    else if (CmdArgC == 3)
  665.       {
  666.       if (CmpArg(1, ">"))
  667.          {
  668.          /* Nachricht weiterleiten */
  669.  
  670.          if (!Lastmsg)
  671.             SysMsg(NO_MSG_READ);
  672.          else
  673.             {
  674.             struct AreaNode *group;
  675.  
  676.             if (group=ChangeArea(CmdArgV[2]))
  677.                {
  678.                CreatePath(group);
  679.  
  680.                PPArg2 = PathString;
  681.                if (YNRequest(CROSS_FORWARD, TRUE))
  682.                   WriteMsg(WF_FORWARD, group, NULL, NULL);
  683.                PPArg2 = NULL;
  684.                }
  685.             else
  686.                SysMsg(INVALID_PATH);
  687.             }
  688.          }
  689.       else if (CmpArg(1, "="))
  690.          {
  691.          /* Nachricht in anderes Brett kopieren/verschieben */
  692.  
  693.          if (!Lastmsg)
  694.             SysMsg(NO_MSG_READ);
  695.          else
  696.             {
  697.             struct AreaNode *group;
  698.  
  699.             if (group=ChangeArea(CmdArgV[2]))
  700.                {
  701.                CreatePath(group);
  702.  
  703.                PPArg2 = PathString;
  704.                if (YNRequest(QUERY_MOVE_MSG, TRUE))
  705.                   {
  706.                   PPArg2 = NULL;
  707.                   if (CloneMsg(Lastmsg, group, FALSE))
  708.                      if (YNRequest(QUERY_DELETE_SOURCE, TRUE))
  709.                         DeleteMsg(NULL, DEL_CURRENT);
  710.                   }
  711.                PPArg2 = NULL;
  712.                }
  713.             else
  714.                SysMsg(INVALID_PATH);
  715.             }
  716.          }
  717.       else if (CmpArg(1, "<"))
  718.          {
  719.          /* Neue Nachricht aus Priv-File in aktuellem Brett */
  720.  
  721.          TEXT dosbuff[LEN_DOSPATH+1];
  722.  
  723.          sprintf(dosbuff, "%s%s/%s",
  724.                           KMSBase->UserDir,
  725.                           KMS_LC->Session.CurrentUser->UserData.Name,
  726.                           CmdArgV[2]);
  727.          ConvertSpace(dosbuff);
  728.  
  729.          if (!Exists(dosbuff))
  730.             SysMsg(FILE_NOT_FOUND);
  731.          else
  732.             WriteMsg(WF_NEW, NULL, dosbuff, NULL);
  733.          }
  734.       else if (CmpArg(1, "!"))
  735.          {
  736.          WriteMsg(WF_NEW|WF_PRIV, NULL, NULL, CmdArgV[2]);
  737.          }
  738.       else
  739.          SysMsg(INVALID_PARAMS);
  740.       }
  741.    else
  742.       SysMsg(TOO_MANY_PARAMS);
  743.    }
  744.  
  745. ///
  746.  
  747. /***************************************
  748.  * Befehl: ANTWORT                     *
  749.  ***************************************
  750.  * I: ---                              *
  751.  * O: ---                              *
  752.  ***************************************/
  753.  
  754. /// "Cmd_ANTWORT"
  755.  
  756. VOID Cmd_ANTWORT(VOID)
  757.    {
  758.    if (KMS_LC->Session.CurrentArea->AreaData.Type & ATYPE_FILES)
  759.       {
  760.       SysMsg(NOT_IN_FILEAREA);
  761.       return;
  762.       }
  763.  
  764.    if (!Lastmsg)
  765.       {
  766.       SysMsg(NO_MSG_READ);
  767.       return;
  768.       }
  769.  
  770.    if (CmdArgC == 1)
  771.       WriteMsg(WF_REPLY, NULL, NULL, NULL);
  772.    else if (CmdArgC == 2)
  773.       {
  774.       if (CmpArg(1, "!"))
  775.          WriteMsg(WF_REPLY|WF_PRIV, NULL, NULL, NULL);
  776.       else
  777.          SysMsg(INVALID_PARAMS);
  778.       }
  779.    else if (CmdArgC == 3)
  780.       {
  781.       if (CmpArg(1, ">"))
  782.          {
  783.          struct AreaNode *group;
  784.  
  785.          if (group=ChangeArea(CmdArgV[2]))
  786.             {
  787.             CreatePath(group);
  788.  
  789.             PPArg2 = PathString;
  790.             if (YNRequest(CROSS_REPLY, TRUE))
  791.                {
  792.                /* Nachricht weiterleiten */
  793.  
  794.                WriteMsg(WF_REPLY, group, NULL, NULL);
  795.                }
  796.             PPArg2 = NULL;
  797.             }
  798.          else
  799.             SysMsg(INVALID_PATH);
  800.          }
  801.       else
  802.          SysMsg(INVALID_PARAMS);
  803.       }
  804.    else
  805.       SysMsg(TOO_MANY_PARAMS);
  806.    }
  807.  
  808. ///
  809.  
  810. /***************************************
  811.  * Befehl: SHUTDOWN                    *
  812.  ***************************************
  813.  * I: ---                              *
  814.  * O: ---                              *
  815.  ***************************************/
  816.  
  817. /// "Cmd_SHUTDOWN"
  818.  
  819. VOID Cmd_SHUTDOWN(VOID)
  820.    {
  821.    if (!(KMS_LC->Device & DEV_CONSOLE))
  822.       {
  823.       SysMsg(SHUTDOWN_IMPOSSIBLE);
  824.       return;
  825.       }
  826.  
  827.    if (CmdArgC == 1) /* Sofortiger lokaler Shutdown */
  828.       {
  829.       SysMsg(LOCAL_IMM_SHUTDOWN);
  830.  
  831.       WORD timeleft = KMS_LC->Session.MaxConnectTime - (MakeTime(NULL, KMS_LC->Session.LoginTime, 0) / 60);
  832.  
  833.       if (timeleft > 0)
  834.          KMS_LC->Session.MaxConnectTime -= timeleft;
  835.  
  836.       ShutDown = SHUTDOWN_IMMEDIATE;
  837.       }
  838.    else if (CmdArgC == 2)
  839.       {
  840.       if (atoi(CmdArgV[1]) > 0)
  841.          {
  842.          TEXT buff[32];
  843.  
  844.          UWORD offset = atoi(CmdArgV[1]);
  845.  
  846.          sprintf(buff, "%d", offset);
  847.          PPArg = buff;
  848.          SysMsg(GLOBAL_SHUTDOWN);
  849.          PPArg = NULL;
  850.  
  851.          WORD timeleft = KMS_LC->Session.MaxConnectTime - (MakeTime(NULL, KMS_LC->Session.LoginTime, 0) / 60);
  852.  
  853.          if (timeleft > offset)
  854.              KMS_LC->Session.MaxConnectTime -= (timeleft - offset);
  855.  
  856.          sprintf(buff, "SHUTDOWN DELAY %d", offset);
  857.          sendRexxCmd(buff, NULL, NULL, NULL, NULL, "KMS");
  858.  
  859.          ShutDown = SHUTDOWN_DELAYED;
  860.          }
  861.       else if (CmpArg(1, "!")) /* Sofortiger globaler Shutdown */
  862.          {
  863.          SysMsg(GLOBAL_IMM_SHUTDOWN);
  864.  
  865.          sendRexxCmd("SHUTDOWN", NULL, NULL, NULL, NULL, "KMS");
  866.          }
  867.       else if (CmpArg(1, "!!")) /* Sofortiger globaler Shutdown mit QuitUMS */
  868.          {
  869.          SysMsg(GLOBAL_IMM_SHUTDOWN);
  870.  
  871.          sendRexxCmd("SHUTDOWN UMS", NULL, NULL, NULL, NULL, "KMS");
  872.          }
  873.      else
  874.          SysMsg(INVALID_PARAMS);
  875.       }
  876.    else if (CmdArgC == 3) /* Shutdown mit Portangabe */
  877.       {
  878.       if (CmpArg(1, ">"))
  879.          {
  880.          if (atoi(CmdArgV[2]) > 0)
  881.             {
  882.             TEXT target[LEN_NUMBER+4+1];
  883.             sprintf(target, "KMS.%d", atoi(CmdArgV[2]));
  884.             sendRexxCmd("SHUTDOWN", NULL, NULL, NULL, NULL, target);
  885.             }
  886.          else
  887.             SysMsg(INVALID_PARAMS);
  888.          }
  889.       else
  890.          SysMsg(INVALID_PARAMS);
  891.       }
  892.    else
  893.       SysMsg(TOO_MANY_PARAMS);
  894.    }
  895.  
  896. ///
  897.  
  898. /***************************************
  899.  * Befehl: UMSINFO                     *
  900.  ***************************************
  901.  * I: ---                              *
  902.  * O: ---                              *
  903.  ***************************************/
  904.  
  905. /// "Cmd_UMSINFO"
  906.  
  907. VOID Cmd_UMSINFO(VOID)
  908.    {
  909.    UMSMsgNum msgnum;
  910.    TEXT buff[32];
  911.    if (CmdArgC == 1)
  912.       {
  913.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_Archive,
  914.                                          UMSTAG_SelMatch, UMSUSTATF_Archive,
  915.                                          TAG_DONE);
  916.       sprintf(buff, "Archive....: %ld", msgnum);
  917.       Print(buff, 0);
  918.  
  919.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_Junk,
  920.                                          UMSTAG_SelMatch, UMSUSTATF_Junk,
  921.                                          TAG_DONE);
  922.       sprintf(buff, "Junk.......: %ld", msgnum);
  923.       Print(buff, 0);
  924.  
  925.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_PostPoned,
  926.                                          UMSTAG_SelMatch, UMSUSTATF_PostPoned,
  927.                                          TAG_DONE);
  928.       sprintf(buff, "PostPoned..: %ld", msgnum);
  929.       Print(buff, 0);
  930.  
  931.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_Selected,
  932.                                          UMSTAG_SelMatch, UMSUSTATF_Selected,
  933.                                          TAG_DONE);
  934.       sprintf(buff, "Selected...: %ld", msgnum);
  935.       Print(buff, 0);
  936.  
  937.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_Filtered,
  938.                                          UMSTAG_SelMatch, UMSUSTATF_Filtered,
  939.                                          TAG_DONE);
  940.       sprintf(buff, "Filtered...: %ld", msgnum);
  941.       Print(buff, 0);
  942.  
  943.       Print("-------------------------------------",0);
  944.  
  945.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_Old,
  946.                                          UMSTAG_SelMatch, UMSUSTATF_Old,
  947.                                          TAG_DONE);
  948.       sprintf(buff, "Read.......: %ld", msgnum);
  949.       Print(buff, 0);
  950.  
  951.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_WriteAccess,
  952.                                          UMSTAG_SelMatch, UMSUSTATF_WriteAccess,
  953.                                          TAG_DONE);
  954.       sprintf(buff, "WriteAccess: %ld", msgnum);
  955.       Print(buff, 0);
  956.  
  957.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_ReadAccess,
  958.                                          UMSTAG_SelMatch, UMSUSTATF_ReadAccess,
  959.                                          TAG_DONE);
  960.       sprintf(buff, "ReadAccess.: %ld", msgnum);
  961.       Print(buff, 0);
  962.  
  963.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_ViewAccess,
  964.                                          UMSTAG_SelMatch, UMSUSTATF_ViewAccess,
  965.                                          TAG_DONE);
  966.       sprintf(buff, "ViewAccess.: %ld", msgnum);
  967.       Print(buff, 0);
  968.  
  969.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,  UMSUSTATF_Owner,
  970.                                          UMSTAG_SelMatch, UMSUSTATF_Owner,
  971.                                          TAG_DONE);
  972.       sprintf(buff, "Owner......: %ld", msgnum);
  973.       Print(buff, 0);
  974.  
  975.       Print("=====================================",0);
  976.  
  977.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
  978.                                          UMSTAG_SelMask,    UMSGSTATF_Deleted,
  979.                                          UMSTAG_SelMatch,   UMSGSTATF_Deleted,
  980.                                          TAG_DONE);
  981.       sprintf(buff, "Deleted....: %ld", msgnum);
  982.       Print(buff, 0);
  983.  
  984.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
  985.                                          UMSTAG_SelMask,    UMSGSTATF_Expired,
  986.                                          UMSTAG_SelMatch,   UMSGSTATF_Expired,
  987.                                          TAG_DONE);
  988.       sprintf(buff, "Expired....: %ld", msgnum);
  989.       Print(buff, 0);
  990.  
  991.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
  992.                                          UMSTAG_SelMask,    UMSGSTATF_Exported,
  993.                                          UMSTAG_SelMatch,   UMSGSTATF_Exported,
  994.                                          TAG_DONE);
  995.       sprintf(buff, "Exported...: %ld", msgnum);
  996.       Print(buff, 0);
  997.  
  998.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
  999.                                          UMSTAG_SelMask,    UMSGSTATF_Orphan,
  1000.                                          UMSTAG_SelMatch,   UMSGSTATF_Orphan,
  1001.                                          TAG_DONE);
  1002.       sprintf(buff, "Orphan.....: %ld", msgnum);
  1003.       Print(buff, 0);
  1004.  
  1005.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
  1006.                                          UMSTAG_SelMask,    UMSGSTATF_Link,
  1007.                                          UMSTAG_SelMatch,   UMSGSTATF_Link,
  1008.                                          TAG_DONE);
  1009.       sprintf(buff, "Link.......: %ld", msgnum);
  1010.       Print(buff, 0);
  1011.  
  1012.       msgnum = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadGlobal, TRUE,
  1013.                                          UMSTAG_SelMask,    UMSGSTATF_HardLink,
  1014.                                          UMSTAG_SelMatch,   UMSGSTATF_HardLink,
  1015.                                          TAG_DONE);
  1016.       sprintf(buff, "HardLink...: %ld", msgnum);
  1017.       Print(buff, 0);
  1018.       }
  1019.    else if (CmdArgC == 2)
  1020.       {
  1021.       if (atol(CmdArgV[1]))
  1022.          MsgStatusInfo(atol(CmdArgV[1]));
  1023.       else
  1024.          SysMsg(INVALID_PARAMS);
  1025.       }
  1026.    else
  1027.       SysMsg(TOO_MANY_PARAMS);
  1028.    }
  1029.  
  1030. ///
  1031.  
  1032. /***************************************
  1033.  * Befehl: HISTORY                     *
  1034.  ***************************************
  1035.  * I: ---                              *
  1036.  * O: ---                              *
  1037.  ***************************************/
  1038.  
  1039. /// "Cmd_HISTORY"
  1040.  
  1041. VOID Cmd_HISTORY(VOID)
  1042.    {
  1043.    if (CmdArgC == 1)
  1044.       {
  1045.       struct HistoryNode *hpoint = KMS_LC->Session.HistPoint;
  1046.       while(hpoint->Node.mln_Pred)
  1047.          {
  1048.          Print(hpoint->Cmd,0);
  1049.          hpoint = hpoint->Node.mln_Pred;
  1050.          }
  1051.       }
  1052.    else
  1053.       {
  1054.       SysMsg(TOO_MANY_PARAMS);
  1055.       }
  1056.    }
  1057.  
  1058. ///
  1059.  
  1060. /***************************************
  1061.  * Befehl: UMSDIR                      *
  1062.  ***************************************
  1063.  * I: ---                              *
  1064.  * O: ---                              *
  1065.  ***************************************/
  1066.  
  1067. /// "Cmd_UMSDIR"
  1068.  
  1069. VOID Cmd_UMSDIR(VOID)
  1070.    {
  1071.    UMSMsgNum msgnum = 0, num = 0;
  1072.    STRPTR areaname;
  1073.    BOOL invers = FALSE;
  1074.    TEXT buff[LEN_NUMBER+3+1];
  1075.  
  1076.    if (CmdArgC > 2)
  1077.       {
  1078.       SysMsg(TOO_MANY_PARAMS);
  1079.       return;
  1080.       }
  1081.    else if (CmdArgC > 1)
  1082.       {
  1083.       if (CmpArg(1, "!")) /* Nicht registrierte Areas ausgeben */
  1084.          invers = TRUE;
  1085.       else
  1086.          {
  1087.          SysMsg(INVALID_PARAMS);
  1088.          return;
  1089.          }
  1090.       }
  1091.  
  1092.    /* Alle gesetzten Local-Flag 8 rücksetzen */
  1093.  
  1094.    UMSSelectTags(MyUMSAccount, UMSTAG_SelWriteLocal, TRUE,
  1095.                                UMSTAG_SelUnset,      KMSLSTATF_Temp2,
  1096.                                TAG_DONE);
  1097.  
  1098.    UMSSelectTags(MyUMSAccount, UMSTAG_SelMask,       UMSUSTATF_ViewAccess,
  1099.                                UMSTAG_SelMatch,      0,
  1100.                                UMSTAG_SelWriteLocal, TRUE,
  1101.                                UMSTAG_SelSet,        KMSLSTATF_Temp2,
  1102.                                TAG_DONE);
  1103.  
  1104.    /* Solange weitere Nachricht mit nicht gesetztem Local-Flag 8 */
  1105.  
  1106.    while(msgnum = UMSSearchTags(MyUMSAccount, UMSTAG_SearchLast,      msgnum,
  1107.                                               UMSTAG_SearchDirection, 1,
  1108.                                               UMSTAG_SearchLocal,     TRUE,
  1109.                                               UMSTAG_SearchMask,      KMSLSTATF_Temp2,
  1110.                                               UMSTAG_SearchMatch,     0,
  1111.                                               TAG_DONE))
  1112.       {
  1113.       /* Gruppennamen besorgen */
  1114.  
  1115.       if (ReadUMSMsgTags(MyUMSAccount, UMSTAG_RMsgNum, msgnum,
  1116.                                        UMSTAG_RGroup, &areaname,
  1117.                                        TAG_DONE))
  1118.          {
  1119.          /* In allen Nachrichten der Gruppe Local-Flag 8 setzen */
  1120.  
  1121.          num = UMSSelectTags(MyUMSAccount, UMSTAG_WGroup,        (STRPTR)areaname ? (STRPTR)areaname : (STRPTR)"",
  1122.                                            UMSTAG_SelWriteLocal, TRUE,
  1123.                                            UMSTAG_SelSet,        KMSLSTATF_Temp2,
  1124.                                            UMSTAG_SelQuick,      TRUE,
  1125.                                            TAG_DONE);
  1126.  
  1127.          /* Wenn Echomail-Gruppe */
  1128.  
  1129.          if (areaname)
  1130.             {
  1131.             /* Gefundene Area ausgeben */
  1132.  
  1133.             if (!invers || !AreaSearch(areaname))
  1134.                {
  1135.                Print(areaname, PF_NOLF|PF_NOBRK);
  1136.                sprintf(buff, " (%ld)", num);
  1137.                Print(buff, 0);
  1138.                }
  1139.             }
  1140.          }
  1141.  
  1142.       /* Message freigeben */
  1143.  
  1144.       FreeUMSMsg(MyUMSAccount, msgnum);
  1145.       }
  1146.    }
  1147.  
  1148. ///
  1149.  
  1150. /***************************************
  1151.  * Befehl: AEDIT                       *
  1152.  ***************************************
  1153.  * I: ---                              *
  1154.  * O: ---                              *
  1155.  ***************************************/
  1156.  
  1157. /// "Cmd_AEDIT"
  1158.  
  1159. VOID Cmd_AEDIT(VOID)
  1160.    {
  1161.    if (FindPort("KMSAM"))
  1162.       {
  1163.       SysMsg(DATA_BEING_PROCESSED);
  1164.       return;
  1165.       }
  1166.  
  1167.    if (CmdArgC == 1)
  1168.       {
  1169.       /* Aktuelle Area editieren */
  1170.  
  1171.       EditArea(NULL, AED_OLD);
  1172.       }
  1173.    else if (CmdArgC == 2)
  1174.       {
  1175.       if (CmpArg(1, "*"))
  1176.          {
  1177.          /* Multiples Area-Edit */
  1178.  
  1179.          AreaModify(NULL, 0);
  1180.          }
  1181.       else if (CmpArg(1, "**"))
  1182.          {
  1183.          /* Multiples Area-Edit */
  1184.  
  1185.          AreaModify(NULL, ALIST_WHOLE);
  1186.          }
  1187.       else
  1188.          {
  1189.          /* Angegebene Area edieren */
  1190.  
  1191.          EditArea(CmdArgV[1], AED_OLD);
  1192.          }
  1193.       }
  1194.    else if (CmdArgC == 3)
  1195.       {
  1196.       if (CmpArg(1, "+"))
  1197.          /* Brett-Neuanlage */
  1198.          EditArea(CmdArgV[2], AED_NEW);
  1199.       else if (CmpArg(1, "-"))
  1200.          /* Brett löschen */
  1201.          RemoveArea(CmdArgV[2]);
  1202.       else if (CmpArg(2, "*"))
  1203.          /* Multiples Area-Edit mit Pfadangabe */
  1204.          AreaModify(CmdArgV[1], 0);
  1205.       else if (CmpArg(2, "**"))
  1206.          /* Multiples Area-Edit mit Pfadangabe global */
  1207.          AreaModify(CmdArgV[1], ALIST_WHOLE);
  1208.       else
  1209.          SysMsg(INVALID_PARAMS);
  1210.       }
  1211.    else
  1212.       SysMsg(TOO_MANY_PARAMS);
  1213.    }
  1214.  
  1215. ///
  1216.  
  1217. /***************************************
  1218.  * Befehl: UMSEXPIRE                   *
  1219.  ***************************************
  1220.  * I: .--                              *
  1221.  * O: ---                              *
  1222.  ***************************************/
  1223.  
  1224. /// "Cmd_UMSEXPIRE"
  1225.  
  1226. VOID Cmd_UMSEXPIRE(VOID)
  1227.    {
  1228.    if (CmdArgC > 3)
  1229.       SysMsg(TOO_MANY_PARAMS);
  1230.    else if (CmdArgC == 2)
  1231.       {
  1232.       if (CmpArg(1, "!")) /* Mit Reset */
  1233.          WaitsyncRexxCmd("EXPIRE RESET", "KMS");
  1234.       else if (CmpArg(1, "#")) /* Auch alle nicht registrierten Groups */
  1235.          WaitsyncRexxCmd("EXPIRE UNLISTED", "KMS");
  1236.       else
  1237.          SysMsg(INVALID_PARAMS);
  1238.       }
  1239.    else if (CmdArgC == 3)
  1240.       {
  1241.       if ((CmpArg(1, "!") && CmpArg(2, "#")) || (CmpArg(1, "#") && CmpArg(2, "!"))) /* Mit Reset, alle nicht reg. Gr. */
  1242.          WaitsyncRexxCmd("EXPIRE RESET UNLISTED", "KMS");
  1243.       else
  1244.          SysMsg(INVALID_PARAMS);
  1245.       }
  1246.    else
  1247.       WaitsyncRexxCmd("EXPIRE", "KMS");
  1248.    }
  1249.  
  1250. ///
  1251.  
  1252. /***************************************
  1253.  * Befehl: USERPREFS                   *
  1254.  ***************************************
  1255.  * I: ---                              *
  1256.  * O: ---                              *
  1257.  ***************************************/
  1258.  
  1259. /// "Cmd_USERPREFS"
  1260.  
  1261. VOID Cmd_USERPREFS(VOID)
  1262.    {
  1263.    if (CmdArgC > 1)
  1264.       SysMsg(TOO_MANY_PARAMS);
  1265.    else
  1266.       EditUserInfo(KMS_LC->Session.CurrentUser, EU_PREFS);
  1267.    }
  1268.  
  1269. ///
  1270.  
  1271. /***************************************
  1272.  * Befehl: TEMPPREFS                   *
  1273.  ***************************************
  1274.  * I: ---                              *
  1275.  * O: ---                              *
  1276.  ***************************************/
  1277.  
  1278. /// Cmd_TEMPPREFS
  1279.  
  1280. VOID Cmd_TEMPPREFS(VOID)
  1281.    {
  1282.    if (CmdArgC > 1)
  1283.       SysMsg(TOO_MANY_PARAMS);
  1284.    else
  1285.       {
  1286.       if(!(KMS_LC->Session.CurrentUser->UserData.Flags & UF_DO_NOT_SAVE))
  1287.          MerkUser.UserData = KMS_LC->Session.CurrentUser->UserData;
  1288.  
  1289.       EditUserInfo(KMS_LC->Session.CurrentUser, EU_PREFS);
  1290.  
  1291.       KMS_LC->Session.CurrentUser->UserData.Flags |= UF_DO_NOT_SAVE;
  1292.       }
  1293.    }
  1294.  
  1295. ///
  1296.  
  1297. /***************************************
  1298.  * Befehl: PASSWORD                    *
  1299.  ***************************************
  1300.  * I: ---                              *
  1301.  * O: ---                              *
  1302.  ***************************************/
  1303.  
  1304. /// "Cmd_PASSWORD"
  1305.  
  1306. VOID Cmd_PASSWORD(VOID)
  1307.    {
  1308.    if (CmdArgC > 1)
  1309.       SysMsg(TOO_MANY_PARAMS);
  1310.    else
  1311.       EditUserInfo(KMS_LC->Session.CurrentUser, EU_PWD);
  1312.    }
  1313.  
  1314. ///
  1315.  
  1316. /***************************************
  1317.  * Befehl: DELETE                      *
  1318.  ***************************************
  1319.  * I: ---                              *
  1320.  * O: ---                              *
  1321.  ***************************************/
  1322.  
  1323. /// "Cmd_DELETE"
  1324.  
  1325. VOID Cmd_DELETE(VOID)
  1326.    {
  1327.    if (CmdArgC == 1)
  1328.       {
  1329.       /* Aktuelle Nachricht löschen */
  1330.  
  1331.       DeleteMsg(NULL, DEL_CURRENT);
  1332.       }
  1333.    else if (CmdArgC == 2)
  1334.       {
  1335.       if (ParseRange(CmdArgV[1]))
  1336.          {
  1337.          /* Nachricht Nr. x löschen */
  1338.  
  1339.          DeleteMsg(NULL, DEL_RANGE);
  1340.          }
  1341.       else if (CmpArg(1, "%") || CmpArg(1, "@"))
  1342.          {
  1343.          /* Alle selektierten Nachrichten in aktueller Gruppe löschen */
  1344.  
  1345.          DeleteMsg(NULL, DEL_SELECTED);
  1346.          }
  1347.       else if (CmpArg(1, "*"))
  1348.          {
  1349.          /* Alle Nachrichten in aktueller Gruppe löschen */
  1350.  
  1351.          DeleteMsg(NULL, DEL_ALL);
  1352.          }
  1353.       else
  1354.          SysMsg(INVALID_PARAMS);
  1355.       }
  1356.    else
  1357.       SysMsg(TOO_MANY_PARAMS);
  1358.    }
  1359.  
  1360. ///
  1361.  
  1362. /***************************************
  1363.  * Befehl: DELPROT                     *
  1364.  ***************************************
  1365.  * I: ---                              *
  1366.  * O: ---                              *
  1367.  ***************************************/
  1368.  
  1369. /// "Cmd_DELPROT"
  1370.  
  1371. VOID Cmd_DELPROT(VOID)
  1372.    {
  1373.    TEXT buff[LEN_NUMBER+1];
  1374.  
  1375.    if (CmdArgC == 1)
  1376.       {
  1377.       /* Aktuelle Nachricht schuetzen */
  1378.  
  1379.       DelProtMsg(PROT_CURRENT, TRUE);
  1380.       }
  1381.    else if (CmdArgC == 2)
  1382.       {
  1383.       /* "DELPROT bereich|+|-|%|?" */
  1384.  
  1385.       if (ParseRange(CmdArgV[1]))
  1386.          DelProtMsg(PROT_RANGE, TRUE);
  1387.       else if (CmpArg(1, "+"))
  1388.          DelProtMsg(PROT_CURRENT, TRUE);
  1389.       else if (CmpArg(1, "-"))
  1390.          DelProtMsg(PROT_CURRENT, FALSE);
  1391.       else if (CmpArg(1, "%") || CmpArg(1, "@"))
  1392.          DelProtMsg(PROT_SELECTED, TRUE);
  1393.       else if (CmpArg(1, "?"))
  1394.          {
  1395.          UMSMsgNum msg;
  1396.  
  1397.          msg = UMSSelectTags(SysUMSAccount, UMSTAG_SelMask,  UMSUSTATF_Archive,
  1398.                                             UMSTAG_SelMatch, UMSUSTATF_Archive,
  1399.                                             TAG_DONE);
  1400.          sprintf(buff, "%ld", msg);
  1401.          PPArg = buff;
  1402.          SysMsg(MSGS_PROTECTED);
  1403.          PPArg = NULL;
  1404.          }
  1405.       else
  1406.          SysMsg(INVALID_PARAMS);
  1407.       }
  1408.    else if (CmdArgC == 3)
  1409.       {
  1410.       if (CmpArg(1, "%") || CmpArg(1, "@"))
  1411.          {
  1412.          /* "DELPROT % +|-": Alle selektierten Msgs (ent-)schuetzen */
  1413.  
  1414.          if (CmpArg(2, "+"))
  1415.             DelProtMsg(PROT_SELECTED, TRUE);
  1416.          else if (CmpArg(2, "-"))
  1417.             DelProtMsg(PROT_SELECTED, FALSE);
  1418.          }
  1419.       else if (ParseRange(CmdArgV[1]))
  1420.          {
  1421.          /* "DELPROT bereich +|-": Nachricht Nr. x (ent-)schuetzen */
  1422.  
  1423.          if (CmpArg(2, "+"))
  1424.             DelProtMsg(PROT_RANGE, TRUE);
  1425.          else if (CmpArg(2, "-"))
  1426.             DelProtMsg(PROT_RANGE, FALSE);
  1427.          }
  1428.       else
  1429.          SysMsg(INVALID_PARAMS);
  1430.       }
  1431.    else
  1432.       SysMsg(TOO_MANY_PARAMS);
  1433.    }
  1434.  
  1435. ///
  1436.  
  1437. /***************************************
  1438.  * Befehl: SELECT                      *
  1439.  ***************************************
  1440.  * I: ---                              *
  1441.  * O: ---                              *
  1442.  ***************************************/
  1443.  
  1444. /// "Cmd_SELECT"
  1445.  
  1446. VOID Cmd_SELECT(VOID)
  1447.    {
  1448.    if (CmdArgC == 1)
  1449.       {
  1450.       /* Aktuelle Msg selektieren */
  1451.  
  1452.       if (!Lastmsg)
  1453.          SysMsg(NO_MSG_READ);
  1454.       else
  1455.          MsgSelect(MS_CURRENT, NULL);
  1456.       }
  1457.    else if (CmdArgC > 1)
  1458.       {
  1459.       UBYTE n = 1;
  1460.  
  1461.       if (!CmpArg(1, "+") && !CmpArg(1, "?") && !CmpArg(1, "-"))
  1462.          MsgSelect(MS_RESET|MS_QUIET, NULL);
  1463.       else if (CmpArg(1, "+"))
  1464.          n++;
  1465.  
  1466.       for(; n < CmdArgC; n++)
  1467.          {
  1468.          if (ParseRange(CmdArgV[n]))
  1469.             MsgSelect(MS_NUM, NULL); /* Bestimmte Nummern */
  1470.          else if (CmpArg(n, "?"))
  1471.             MsgSelect(MS_RESULT, NULL); /* Anzahl selektierter */
  1472.          else if (CmpArg(n, "!"))
  1473.             MsgSelect(MS_NEW, NULL); /* Alle alten deselektieren */
  1474.          else if (CmpArg(n, "#"))
  1475.             MsgSelect(MS_AREA, NULL); /* Nur Nachr. im aktuellen Brett! */
  1476.          else if (CmpArg(n, "<"))
  1477.             {
  1478.             n++;
  1479.             if (n < CmdArgC)
  1480.                MsgSelect(MS_FROM, CmdArgV[n]);
  1481.             else
  1482.                SysMsg(TOO_FEW_PARAMS);
  1483.             }
  1484.          else if (CmpArg(n, "<<"))
  1485.             MsgSelect(MS_FROM, KMS_LC->Session.CurrentUser->UserData.RealName);
  1486.          else if (CmpArg(n, "&<"))
  1487.             {
  1488.             n++;
  1489.             if (n < CmdArgC)
  1490.                MsgSelect(MS_AND|MS_FROM, CmdArgV[n]);
  1491.             else
  1492.                SysMsg(TOO_FEW_PARAMS);
  1493.             }
  1494.          else if (CmpArg(n, "&<<"))
  1495.             MsgSelect(MS_AND|MS_FROM, KMS_LC->Session.CurrentUser->UserData.RealName);
  1496.          else if (CmpArg(n, ">"))
  1497.             {
  1498.             n++;
  1499.             if (n < CmdArgC)
  1500.                MsgSelect(MS_TO, CmdArgV[n]);
  1501.             else
  1502.                SysMsg(TOO_FEW_PARAMS);
  1503.             }
  1504.          else if (CmpArg(n, ">>"))
  1505.             MsgSelect(MS_TO, KMS_LC->Session.CurrentUser->UserData.RealName);
  1506.          else if (CmpArg(n, "&>"))
  1507.             {
  1508.             n++;
  1509.             if (n < CmdArgC)
  1510.                MsgSelect(MS_AND|MS_TO, CmdArgV[n]);
  1511.             else
  1512.                SysMsg(TOO_FEW_PARAMS);
  1513.             }
  1514.          else if (CmpArg(n, "&>>"))
  1515.             MsgSelect(MS_AND|MS_TO, KMS_LC->Session.CurrentUser->UserData.RealName);
  1516.          else if (CmpArg(n, "="))
  1517.             {
  1518.             n++;
  1519.             if (n < CmdArgC)
  1520.                MsgSelect(MS_SUBJECT, CmdArgV[n]);
  1521.             else
  1522.                SysMsg(TOO_FEW_PARAMS);
  1523.             }
  1524.          else if (CmpArg(n, "&="))
  1525.             {
  1526.             n++;
  1527.             if (n < CmdArgC)
  1528.                MsgSelect(MS_AND|MS_SUBJECT, CmdArgV[n]);
  1529.             else
  1530.                SysMsg(TOO_FEW_PARAMS);
  1531.             }
  1532.          else if (CmpArg(n, "%"))
  1533.             {
  1534.             n++;
  1535.             if (n < CmdArgC)
  1536.                MsgSelect(MS_UMSGROUP, CmdArgV[n]);
  1537.             else
  1538.                SysMsg(TOO_FEW_PARAMS);
  1539.             }
  1540.          else if (CmpArg(n, "&%"))
  1541.             {
  1542.             n++;
  1543.             if (n < CmdArgC)
  1544.                MsgSelect(MS_AND|MS_UMSGROUP, CmdArgV[n]);
  1545.             else
  1546.                SysMsg(TOO_FEW_PARAMS);
  1547.             }
  1548.          else if (CmpArg(n, "$"))
  1549.             MsgSelect(MS_DEFAULT, NULL); /* Antworten auf eigene */
  1550.          else if (CmpArg(n, "&$"))
  1551.             MsgSelect(MS_AND|MS_DEFAULT, NULL); /* Antworten auf eigene */
  1552.          else if (CmpArg(n, "-")) /* Einzelne deselektieren */
  1553.             {
  1554.             n++;
  1555.             if (n < CmdArgC)
  1556.                {
  1557.                if (ParseRange(CmdArgV[n]))
  1558.                   MsgSelect(MS_DESELECT|MS_NUM, NULL);
  1559.                else
  1560.                   SysMsg(INVALID_PARAMS);
  1561.                }
  1562.             else
  1563.                SysMsg(TOO_FEW_PARAMS);
  1564.             }
  1565.          else
  1566.             {
  1567.             n = CmdArgC;
  1568.             SysMsg(INVALID_PARAMS);
  1569.             }
  1570.          }
  1571.       }
  1572.    }
  1573.  
  1574. ///
  1575.  
  1576. /***************************************
  1577.  * Befehl: HIDE                        *
  1578.  ***************************************
  1579.  * I: ---                              *
  1580.  * O: ---                              *
  1581.  ***************************************/
  1582.  
  1583. /// "Cmd_HIDE"
  1584.  
  1585. VOID Cmd_HIDE(VOID)
  1586.    {
  1587.    if (CmdArgC == 1)
  1588.       SysMsg(TOO_FEW_PARAMS);
  1589.    else if (CmdArgC == 2)
  1590.       {
  1591.       if (CmpArg(1, "%") || CmpArg(1, "@"))
  1592.          MarkRead(MR_SELECTED, NULL);
  1593.       else if (CmpArg(1, "/") || CmpArg(1, "="))
  1594.          MarkRead(MR_THREAD|MR_CURRENT, NULL);
  1595.       else if (CmpArg(1, "<"))
  1596.          MarkRead(MR_FROM|MR_CURRENT, NULL);
  1597.       else if (CmpArg(1, "*"))
  1598.          MarkRead(MR_ALL, NULL);
  1599.       else if (ParseRange(CmdArgV[1]))
  1600.          MarkRead(MR_RANGE, NULL);
  1601.       else
  1602.          SysMsg(INVALID_PARAMS);
  1603.       }
  1604.    else if (CmdArgC == 3)
  1605.       {
  1606.       if (CmpArg(1, "/") || CmpArg(1, "="))
  1607.          MarkRead(MR_THREAD, CmdArgV[2]);
  1608.       else if (CmpArg(1, "<"))
  1609.          MarkRead(MR_FROM, CmdArgV[2]);
  1610.       else if (CmpArg(2, "*"))
  1611.          {
  1612.          if (CmpArg(1, "%") || CmpArg(1, "@"))
  1613.             MarkRead(MR_SELECTED|MR_GLOBAL, NULL);
  1614.          if (CmpArg(1, "/") || CmpArg(1, "="))
  1615.             MarkRead(MR_THREAD|MR_GLOBAL|MR_CURRENT, NULL);
  1616.          else if (CmpArg(1, "<"))
  1617.             MarkRead(MR_FROM|MR_GLOBAL|MR_CURRENT, NULL);
  1618.          else if (CmpArg(1, "*"))
  1619.             MarkRead(MR_ALL|MR_GLOBAL, NULL);
  1620.          else if (ParseRange(CmdArgV[1]))
  1621.             MsgSelect(MR_RANGE|MR_GLOBAL, NULL);
  1622.          else
  1623.             SysMsg(INVALID_PARAMS);
  1624.          }
  1625.       else
  1626.          SysMsg(INVALID_PARAMS);
  1627.       }
  1628.    else if (CmdArgC == 4)
  1629.       {
  1630.       if (CmpArg(3, "*"))
  1631.          {
  1632.          if (CmpArg(1, "<"))
  1633.             MarkRead(MR_FROM|MR_GLOBAL, CmdArgV[2]);
  1634.          else
  1635.             SysMsg(INVALID_PARAMS);
  1636.          }
  1637.       else
  1638.          SysMsg(INVALID_PARAMS);
  1639.       }
  1640.    else
  1641.       SysMsg(TOO_MANY_PARAMS);
  1642.    }
  1643.  
  1644. ///
  1645.  
  1646. /***************************************
  1647.  * Befehl: PORTLIST                    *
  1648.  ***************************************
  1649.  * I: ---                              *
  1650.  * O: ---                              *
  1651.  ***************************************/
  1652.  
  1653. /// "Cmd_PORTLIST"
  1654.  
  1655. VOID Cmd_PORTLIST(VOID)
  1656.    {
  1657.    struct KMSNode *member = KMSBase->MemberList.mlh_Head;
  1658.    TEXT status[8];
  1659.    TEXT timebuff[18];
  1660.    TEXT linespeed[LEN_NUMBER+1];
  1661.    TEXT lvlbuff[4];
  1662.    TEXT buff[80];
  1663.  
  1664.    SysMsg(PORTLST_HEAD);
  1665.  
  1666.    TakeMSem(FALSE);
  1667.    while(member->Node.mln_Succ)
  1668.       {
  1669.       if (*(member->LCPtr->Session.CurrentUser->UserData.Name))
  1670.          {
  1671.          MakeTime(buff, 0, member->LCPtr->Session.LoginTime);
  1672.          strcpy(timebuff, buff+9);
  1673.          }
  1674.       else
  1675.          strcpy(timebuff, "--------");
  1676.  
  1677.       if (member->LCPtr->Session.LineSpeed)
  1678.          sprintf(linespeed, "%ld", member->LCPtr->Session.LineSpeed);
  1679.       else
  1680.          strcpy(linespeed, "--?--");
  1681.  
  1682.       sprintf(lvlbuff, "%3d", member->LCPtr->Session.CurrentUser->UserData.Level);
  1683.  
  1684.       if (member->LCPtr->Session.LineSpeed)
  1685.          strcpy(status, "Online ");
  1686.       else if (*(member->LCPtr->Session.CurrentUser->UserData.Name))
  1687.          {
  1688.          strcpy(status, "Local");
  1689.          strcpy(linespeed, "-----");
  1690.          }
  1691.       else if (member->LCPtr->Locked)
  1692.          strcpy(status, "Locked ");
  1693.       else
  1694.          {
  1695.          strcpy(status, "Waiting");
  1696.          strcpy(timebuff, "");
  1697.          strcpy(linespeed, "");
  1698.          strcpy(lvlbuff, "");
  1699.          }
  1700.  
  1701.       if (member->LCPtr->Session.CurrentUser->UserData.Flags & UF_PDAT_SECRET)
  1702.          sprintf(buff, "%2d %-7s %-10.10s %-15.15s %-3.3s %-8.8s %-5.5s %s", member->LCPtr->ID, status, member->LCPtr->Session.CurrentUser->UserData.Name, "", "", "", linespeed, "");
  1703.       else
  1704.          sprintf(buff, "%2d %-7s %-10.10s %-15.15s %-3.3s %-8.8s %-5.5s %s", member->LCPtr->ID, status, member->LCPtr->Session.CurrentUser->UserData.Name, member->LCPtr->Session.CurrentUser->UserData.City, lvlbuff, timebuff, linespeed, member->LCPtr->Session.CurrCmd);
  1705.       Print(buff, 0);
  1706.  
  1707.       member = member->Node.mln_Succ;
  1708.       }
  1709.    DropMSem();
  1710.    }
  1711.  
  1712. ///
  1713.  
  1714. /***************************************
  1715.  * Befehl: KMSREXX                     *
  1716.  ***************************************
  1717.  * I: Kommandonummer                   *
  1718.  * O: ---                              *
  1719.  ***************************************/
  1720.  
  1721. /// "Cmd_KMSREXX"
  1722.  
  1723. VOID Cmd_KMSREXX(UWORD cmdnum)
  1724.    {
  1725.    TEXT buff[LEN_CMDINPUT+1];
  1726.    struct CommandNode *cpoint = KMSBase->CommandList.mlh_Head;
  1727.  
  1728.    /* Gegebenes Kommando als ARexx-Skript auszuführen versuchen */
  1729.  
  1730.    /* Zunächst vollständigen Kommandonamen besorgen */
  1731.  
  1732.    while(cpoint->Node.mln_Succ && cpoint->ID != cmdnum)
  1733.       cpoint = cpoint->Node.mln_Succ;
  1734.  
  1735.    /* Jetzt Aufruf-String aufbauen */
  1736.  
  1737.    strcpy(buff, KMSBase->RexxDir);
  1738.    strcat(buff, cpoint->Name);
  1739.    strcat(buff, " ");
  1740.  
  1741.    UBYTE n;
  1742.    for(n = 1; n < CmdArgC; n++)
  1743.       {
  1744.       if (strlen(buff) + strlen(CmdArgV[n]) + 1 <= LEN_CMDINPUT)
  1745.          {
  1746.          strcat(buff, CmdArgV[n]);
  1747.          strcat(buff, " ");
  1748.          }
  1749.       }
  1750.    buff[strlen(buff) - 1] = '\0';
  1751.  
  1752.    /* Rexx-Aufruf */
  1753.  
  1754.    if (!ExecKMSRexx(buff))
  1755.       SystemError("Cmd_KMSREXX", "KMS-Rexx-script not found");
  1756.    }
  1757.  
  1758. ///
  1759.  
  1760. /***************************************
  1761.  * Befehl: KMSBATCH                    *
  1762.  ***************************************
  1763.  * I: ---                              *
  1764.  * O: ---                              *
  1765.  ***************************************/
  1766.  
  1767. /// "Cmd_KMSBATCH"
  1768.  
  1769. VOID Cmd_KMSBATCH(VOID)
  1770.    {
  1771.    TEXT dosbuff[LEN_DOSPATH+1];
  1772.  
  1773.    if (CmdArgC < 2)
  1774.       SysMsg(TOO_FEW_PARAMS);
  1775.    else
  1776.       {
  1777.       /* Gegebenes Kommando als KMS-Batchdatei auszuführen versuchen */
  1778.  
  1779.       strncpy(dosbuff, CmdArgV[1], LEN_DOSPATH-4);
  1780.          dosbuff[LEN_DOSPATH-4] = '\0';
  1781.       strcat(dosbuff, ".COM");
  1782.  
  1783.       if (!Batch(dosbuff, BATCH_USER))
  1784.          SysMsg(BATCH_NOT_FOUND);
  1785.       }
  1786.    }
  1787.  
  1788. ///
  1789.  
  1790. /***************************************
  1791.  * Befehl: ECHO                        *
  1792.  ***************************************
  1793.  * I: ---                              *
  1794.  * O: ---                              *
  1795.  ***************************************/
  1796.  
  1797. /// "Cmd_ECHO"
  1798.  
  1799. VOID Cmd_ECHO(VOID)
  1800.    {
  1801.    if (CmdArgC > 3)
  1802.       {
  1803.       SysMsg(TOO_MANY_PARAMS);
  1804.       }
  1805.    else if (CmdArgC == 1)
  1806.       {
  1807.       if (KMS_LC->Session.Echo)
  1808.          SysMsg(ECHO_ON);
  1809.       else
  1810.          {
  1811.          KMS_LC->Session.Echo = TRUE;
  1812.          SysMsg(ECHO_OFF);
  1813.          KMS_LC->Session.Echo = FALSE;
  1814.          }
  1815.       }
  1816.    else if (CmdArgC == 2)
  1817.       {
  1818.       if (CmpArg(1, "+"))
  1819.          {
  1820.          KMS_LC->Session.Echo = TRUE;
  1821.          SysMsg(ECHO_ON);
  1822.          }
  1823.       else if (CmpArg(1, "+!"))
  1824.          {
  1825.          KMS_LC->Session.Echo = TRUE;
  1826.          }
  1827.       else if (CmpArg(1, "-"))
  1828.          {
  1829.          KMS_LC->Session.Echo = TRUE;
  1830.          SysMsg(ECHO_OFF);
  1831.          KMS_LC->Session.Echo = FALSE;
  1832.          }
  1833.       else if (CmpArg(1, "-!"))
  1834.          {
  1835.          KMS_LC->Session.Echo = FALSE;
  1836.          }
  1837.       else
  1838.          {
  1839.          BOOL crsmerk;
  1840.  
  1841.          if (crsmerk = KMS_LC->Cursor)
  1842.             CursorOff();
  1843.          ParsePrint(CmdArgV[1], 0);
  1844.          if (crsmerk)
  1845.             CursorOn();
  1846.          }
  1847.       }
  1848.    else if (CmdArgC == 3)
  1849.       {
  1850.       if (CmpArg(2, "|") || CmpArg(2, "NOLINE")) /* wg. REXX */
  1851.          {
  1852.          BOOL crsmerk;
  1853.  
  1854.          if (crsmerk = KMS_LC->Cursor)
  1855.             CursorOff();
  1856.          ParsePrint(CmdArgV[1], PF_NOLF|PF_NOBRK);
  1857.          if (crsmerk)
  1858.             CursorOn();
  1859.          }
  1860.       else
  1861.          SysMsg(INVALID_PARAMS);
  1862.       }
  1863.    }
  1864.  
  1865. ///
  1866.  
  1867. /***************************************
  1868.  * Befehl: LABERFILTER                 *
  1869.  ***************************************
  1870.  * I: ---                              *
  1871.  * O: ---                              *
  1872.  ***************************************/
  1873.  
  1874. /// "Cmd_LABERFILTER"
  1875.  
  1876. VOID Cmd_LABERFILTER(VOID)
  1877.    {
  1878.    if (CmdArgC == 1)
  1879.       {
  1880.       /* Laberfilter-Datei defaultmäßig bearbeiten */
  1881.  
  1882.       ExecKillFile();
  1883.       }
  1884.    else if (CmdArgC == 2)
  1885.       {
  1886.       if (CmpArg(1, "?"))      /* Listeneinträge anzeigen */
  1887.          ListKillFile();
  1888.       else if (CmpArg(1, "+"))      /* Listeneintrage hinzufügen */
  1889.          AddKillEntry(0);
  1890.       else if (CmpArg(1, "-"))      /* Listeneintrag löschen */
  1891.          {
  1892.          if (ListKillFile())
  1893.             DelKillEntry();
  1894.          }
  1895.       else if (CmpArg(1, "+="))     /* Aktuellen Betreff aufnehmen */
  1896.          AddKillEntry(HKF_CURRSUBJ);
  1897.       else if (CmpArg(1, "+<"))     /* Aktuellen Autor aufnehmen */
  1898.          AddKillEntry(HKF_CURRFROM);
  1899.       else if (CmpArg(1, "+*"))     /* Aktuellen Autor global aufnehmen */
  1900.          AddKillEntry(HKF_CURRFROM|HKF_GLOBAL);
  1901.       else if (CmpArg(1, "+#"))     /* Aktuelle Area aufnehmen */
  1902.          AddKillEntry(HKF_CURRAREA);
  1903.       else
  1904.          SysMsg(INVALID_PARAMS);
  1905.       }
  1906.    else
  1907.       SysMsg(TOO_MANY_PARAMS);
  1908.    }
  1909.  
  1910. ///
  1911.  
  1912. /***************************************
  1913.  * Befehl: VORMERKER                   *
  1914.  ***************************************
  1915.  * I: ---                              *
  1916.  * O: ---                              *
  1917.  ***************************************/
  1918.  
  1919. /// "Cmd_VORMERKER"
  1920.  
  1921. VOID Cmd_VORMERKER(VOID)
  1922.    {
  1923.    if (CmdArgC == 1)
  1924.       {
  1925.       /* Auto-Select-Datei defaultmäßig bearbeiten */
  1926.  
  1927.       ExecSelFile(HSF_NEWS);
  1928.       }
  1929.    else if (CmdArgC == 2)
  1930.       {
  1931.       if (CmpArg(1, "*"))           /* Auch alte selektieren */
  1932.          ExecSelFile(0);
  1933.       else if (CmpArg(1, "?"))      /* Listeneinträge anzeigen */
  1934.          ListSelFile();
  1935.       else if (CmpArg(1, "+"))      /* Listeneintrage hinzufügen */
  1936.          AddSelEntry(0);
  1937.       else if (CmpArg(1, "-"))      /* Listeneintrag löschen */
  1938.          {
  1939.          if (ListSelFile())
  1940.             DelSelEntry();
  1941.          }
  1942.       else if (CmpArg(1, "+="))     /* Aktuellen Betreff aufnehmen */
  1943.          AddSelEntry(HSF_CURRSUBJ);
  1944.       else if (CmpArg(1, "+<"))     /* Aktuellen Autor aufnehmen */
  1945.          AddSelEntry(HSF_CURRFROM);
  1946.       else
  1947.          SysMsg(INVALID_PARAMS);
  1948.       }
  1949.    else
  1950.       SysMsg(TOO_MANY_PARAMS);
  1951.    }
  1952.  
  1953. ///
  1954.  
  1955. /***************************************
  1956.  * Befehl: UEDIT                       *
  1957.  ***************************************
  1958.  * I: ---                              *
  1959.  * O: ---                              *
  1960.  ***************************************/
  1961.  
  1962. /// "Cmd_UEDIT"
  1963.  
  1964. VOID Cmd_UEDIT(VOID)
  1965.    {
  1966.    if (FindPort("KMSUM"))
  1967.       {
  1968.       SysMsg(DATA_BEING_PROCESSED);
  1969.       return;
  1970.       }
  1971.  
  1972.    if (CmdArgC == 1)
  1973.       {
  1974.       /* Aktuellen User editieren */
  1975.  
  1976.       EditUser(NULL);
  1977.       }
  1978.    else if (CmdArgC == 2)
  1979.       {
  1980.       if (CmpArg(1, "?"))
  1981.          ListUsers(NULL);
  1982.       else if (CmpArg(1, "*"))
  1983.          GlobalUserEdit();
  1984.       else
  1985.          {
  1986.          /* Angegebenen User edieren */
  1987.  
  1988.          if (UserCheck(CmdArgV[1]))
  1989.             EditUser(CmdArgV[1]);
  1990.          else
  1991.             SysMsg(USER_NOT_FOUND);
  1992.          }
  1993.       }
  1994.    else if (CmdArgC == 3)
  1995.       {
  1996.       if (CmpArg(1, "+"))
  1997.          {
  1998.          /* Angegebenen User neu anlegen */
  1999.  
  2000.          if (UserCheck(CmdArgV[2]))
  2001.             SysMsg(USER_ALREADY_EXISTS);
  2002.          else
  2003.             EditUser(CmdArgV[2]);
  2004.          }
  2005.       else if (CmpArg(1, "-"))
  2006.          RemoveUser(CmdArgV[2]);
  2007.       else if (CmpArg(1, "?"))
  2008.          ListUsers(CmdArgV[2]);
  2009.       else
  2010.          SysMsg(INVALID_PARAMS);
  2011.       }
  2012.    else
  2013.       SysMsg(TOO_MANY_PARAMS);
  2014.    }
  2015.  
  2016. ///
  2017.  
  2018. /***************************************
  2019.  * Befehl: UDIR                        *
  2020.  ***************************************
  2021.  * I: ---                              *
  2022.  * O: ---                              *
  2023.  ***************************************/
  2024.  
  2025. /// "Cmd_UDIR"
  2026.  
  2027. VOID Cmd_UDIR(VOID)
  2028.    {
  2029.    if (CmdArgC == 1)
  2030.       {
  2031.       /* Alle User listen */
  2032.  
  2033.       ListUsers(NULL);
  2034.       }
  2035.    else if (CmdArgC == 2)
  2036.       {
  2037.       /* Angegebenen User listen */
  2038.  
  2039.       ListUsers(CmdArgV[1]);
  2040.       }
  2041.    else
  2042.       SysMsg(TOO_MANY_PARAMS);
  2043.    }
  2044.  
  2045. ///
  2046.  
  2047. /***************************************
  2048.  * Befehl: PEDIT (Files in UserDir)    *
  2049.  ***************************************
  2050.  * I: ---                              *
  2051.  * O: ---                              *
  2052.  ***************************************/
  2053.  
  2054. /// "Cmd_PEDIT"
  2055.  
  2056. VOID Cmd_PEDIT(VOID)
  2057.    {
  2058.    if (CmdArgC < 2)
  2059.       SysMsg(TOO_FEW_PARAMS);
  2060.    else if (CmdArgC > 2)
  2061.       SysMsg(TOO_MANY_PARAMS);
  2062.    else
  2063.       {
  2064.       if (KMS_LC->Session.CurrentUser->UserData.Level < 255 && (strchr(CmdArgV[1], '/') || strchr(CmdArgV[1], ':') || strstr(CmdArgV[1], ".KMS")))
  2065.          SysMsg(INVALID_PARAMS);
  2066.       else
  2067.          BatchEdit(CmdArgV[1]);
  2068.       }
  2069.    }
  2070.  
  2071. ///
  2072.  
  2073. /***************************************
  2074.  * Befehl: PDELETE (Files in UserDir)  *
  2075.  ***************************************
  2076.  * I: ---                              *
  2077.  * O: ---                              *
  2078.  ***************************************/
  2079.  
  2080. /// "Cmd_PDELETE"
  2081.  
  2082. VOID Cmd_PDELETE(VOID)
  2083.    {
  2084.    if (CmdArgC < 2)
  2085.       SysMsg(TOO_FEW_PARAMS);
  2086.    else if (CmdArgC > 2)
  2087.       SysMsg(TOO_MANY_PARAMS);
  2088.    else
  2089.       {
  2090.       if (strchr(CmdArgV[1], '/') || strchr(CmdArgV[1], ':') || strstr(CmdArgV[1], ".KMS"))
  2091.          SysMsg(INVALID_PARAMS);
  2092.       else if (BatchDelete(CmdArgV[1]))
  2093.          SysMsg(PFILE_DELETED);
  2094.       else
  2095.          SysMsg(FILE_NOT_FOUND);
  2096.       }
  2097.    }
  2098.  
  2099. ///
  2100.  
  2101. /***************************************
  2102.  * Befehl: PDIR (Files in UserDir)     *
  2103.  ***************************************
  2104.  * I: ---                              *
  2105.  * O: ---                              *
  2106.  ***************************************/
  2107.  
  2108. /// "Cmd_PDIR"
  2109.  
  2110. VOID Cmd_PDIR(VOID)
  2111.    {
  2112.    if (CmdArgC > 1)
  2113.       SysMsg(TOO_MANY_PARAMS);
  2114.    else
  2115.       BatchDir();
  2116.    }
  2117.  
  2118. ///
  2119.  
  2120. /***************************************
  2121.  * Befehl: PUPLOAD (Files > UserDir)   *
  2122.  ***************************************
  2123.  * I: ---                              *
  2124.  * O: ---                              *
  2125.  ***************************************/
  2126.  
  2127. /// "Cmd_PUPLOAD"
  2128.  
  2129. VOID Cmd_PUPLOAD(VOID)
  2130.    {
  2131.    if (CmdArgC > 1)
  2132.       SysMsg(TOO_MANY_PARAMS);
  2133.    else
  2134.       BatchUpload();
  2135.    }
  2136.  
  2137. ///
  2138.  
  2139. /***************************************
  2140.  * Befehl: PDOWNLOAD (UserDir)         *
  2141.  ***************************************
  2142.  * I: ---                              *
  2143.  * O: ---                              *
  2144.  ***************************************/
  2145.  
  2146. /// "Cmd_PDOWNLOAD"
  2147.  
  2148. VOID Cmd_PDOWNLOAD(VOID)
  2149.    {
  2150.    if (CmdArgC < 2)
  2151.       SysMsg(TOO_FEW_PARAMS);
  2152.    else if (CmdArgC > 2)
  2153.       SysMsg(TOO_MANY_PARAMS);
  2154.    else
  2155.       Download(0, DOWN_XFER|DOWN_PRIVATE, CmdArgV[1]);
  2156.    }
  2157.  
  2158. ///
  2159.  
  2160. /***************************************
  2161.  * Befehl: SIGEDIT (Signature)         *
  2162.  ***************************************
  2163.  * I: ---                              *
  2164.  * O: ---                              *
  2165.  ***************************************/
  2166.  
  2167. /// "Cmd_SIGEDIT"
  2168.  
  2169. VOID Cmd_SIGEDIT(VOID)
  2170.    {
  2171.    if (CmdArgC > 1)
  2172.       SysMsg(TOO_MANY_PARAMS);
  2173.    else
  2174.       BatchEdit("SIGNATURE.KMS");
  2175.    }
  2176.  
  2177. ///
  2178.  
  2179. /***************************************
  2180.  * Befehl: INFO                        *
  2181.  ***************************************
  2182.  * I: ---                              *
  2183.  * O: ---                              *
  2184.  ***************************************/
  2185.  
  2186. /// "Cmd_INFO"
  2187.  
  2188. extern STRPTR KMSTitle;
  2189.  
  2190. VOID Cmd_INFO(VOID)
  2191.    {
  2192.    if (CmdArgC > 1)
  2193.       SysMsg(TOO_MANY_PARAMS);
  2194.    else
  2195.       {
  2196.       Print(KMSTitle, PF_NOLF|PF_NOBRK);
  2197.       Print(" * Karfunkel Mailbox System * (c)1993-95 Thomas Schwarz", PF_NOBRK);
  2198.       Print(NULL, PF_NOBRK);
  2199.  
  2200.       SysMsg(USER_INFO);
  2201.       }
  2202.    }
  2203.  
  2204. ///
  2205.  
  2206. /***************************************
  2207.  * Befehl: ALIAS                       *
  2208.  ***************************************
  2209.  * I: ---                              *
  2210.  * O: ---                              *
  2211.  ***************************************/
  2212.  
  2213. /// "Cmd_ALIAS"
  2214.  
  2215. VOID Cmd_ALIAS(VOID)
  2216.    {
  2217.    if (CmdArgC == 1)
  2218.       SysMsg(TOO_FEW_PARAMS);
  2219.    else if (CmdArgC == 2)
  2220.       {
  2221.       if (CmpArg(1, "?"))           /* Listeneinträge anzeigen */
  2222.          ListAliasFile();
  2223.       else if (CmpArg(1, "+"))      /* Listeneintrag hinzufügen */
  2224.          AddAliasEntry(0);
  2225.       else if (CmpArg(1, "-"))      /* Listeneintrag löschen */
  2226.          {
  2227.          if (ListAliasFile())
  2228.             DelAliasEntry();
  2229.          }
  2230.       else if (CmpArg(1, "+="))     /* Aktuellen Autor/Adresse aufnehmen */
  2231.          AddAliasEntry(GA_CURRENT);
  2232.       else
  2233.          SysMsg(INVALID_PARAMS);
  2234.       }
  2235.    else
  2236.       SysMsg(TOO_MANY_PARAMS);
  2237.    }
  2238.  
  2239. ///
  2240.  
  2241. /***************************************
  2242.  * Befehl: LOG                         *
  2243.  ***************************************
  2244.  * I: ---                              *
  2245.  * O: ---                              *
  2246.  ***************************************/
  2247.  
  2248. /// "Cmd_LOG"
  2249.  
  2250. VOID Cmd_LOG(VOID)
  2251.    {
  2252.    if (CmdArgC == 1)
  2253.       SysMsg(TOO_FEW_PARAMS);
  2254.    else if (CmdArgC == 2)
  2255.       {
  2256.       if (CmpArg(1, "+"))
  2257.          {
  2258.          KMS_LC->OutputLog = TRUE;
  2259.          SysMsg(LOG_ENABLED);
  2260.          }
  2261.       else if (CmpArg(1, "-"))
  2262.          {
  2263.          KMS_LC->OutputLog = FALSE;
  2264.          SysMsg(LOG_DISABLED);
  2265.          }
  2266.       else if (CmpArg(1, "?"))
  2267.          {
  2268.          if (KMS_LC->OutputLog)
  2269.             SysMsg(LOG_ENABLED);
  2270.          else
  2271.             SysMsg(LOG_DISABLED);
  2272.          }
  2273.       else
  2274.          SysMsg(INVALID_PARAMS);
  2275.       }
  2276.    else
  2277.       SysMsg(TOO_MANY_PARAMS);
  2278.    }
  2279.  
  2280. ///
  2281.  
  2282. /***************************************
  2283.  * Befehl: ACLEDIT                     *
  2284.  ***************************************
  2285.  * I: ---                              *
  2286.  * O: ---                              *
  2287.  ***************************************/
  2288.  
  2289. /// "Cmd_ACLEDIT"
  2290.  
  2291. VOID Cmd_ACLEDIT(VOID)
  2292.    {
  2293.    if (CmdArgC == 1)
  2294.       SysMsg(TOO_FEW_PARAMS);
  2295.    else if (CmdArgC == 2)
  2296.       {
  2297.       if (CmpArg(1, "?"))
  2298.          ListACL();
  2299.       else
  2300.          EditACL(CmdArgV[1]);
  2301.       }
  2302.    else if (CmdArgC == 3)
  2303.       {
  2304.       if (CmpArg(1, "+"))
  2305.          EditACL(CmdArgV[2]);
  2306.       else if (CmpArg(1, "-"))
  2307.          DeleteACL(CmdArgV[2]);
  2308.       else
  2309.          SysMsg(INVALID_PARAMS);
  2310.       }
  2311.    else
  2312.       SysMsg(TOO_MANY_PARAMS);
  2313.    }
  2314.  
  2315. ///
  2316.  
  2317. /***************************************
  2318.  * Befehl: SYSMSG                      *
  2319.  ***************************************
  2320.  * I: ---                              *
  2321.  * O: ---                              *
  2322.  ***************************************/
  2323.  
  2324. /// "Cmd_SYSMSG"
  2325.  
  2326. VOID Cmd_SYSMSG(VOID)
  2327.    {
  2328.    TEXT buff[LEN_CMDINPUT*2];
  2329.  
  2330.    if (CmdArgC < 2)
  2331.       SysMsg(TOO_FEW_PARAMS);
  2332.    else if (CmdArgC == 2)
  2333.       {
  2334.       if (CmpArg(1, "+"))
  2335.          {
  2336.          KMS_LC->Session.CommMode &= ~CM_LOCKED;
  2337.          SysMsg(COMMS_ENABLED);
  2338.          }
  2339.       else if (CmpArg(1, "-"))
  2340.          {
  2341.          KMS_LC->Session.CommMode |= CM_LOCKED;
  2342.          SysMsg(COMMS_DISABLED);
  2343.          }
  2344.       else
  2345.          SysMsg(INVALID_PARAMS);
  2346.       }
  2347.    else
  2348.       {
  2349.       STRPTR point;
  2350.       BOOL urgent;
  2351.  
  2352.       if (CmpArg(1, "!"))
  2353.          {
  2354.          urgent = TRUE;
  2355.          point = strstr(KMS_LC->Session.InputBuffer, CmdArgV[2]);
  2356.          sprintf(buff, "OUT NOPARSE TEXT \r\07%s: %s", KMS_LC->Session.CurrentUser->UserData.Name, point + strlen(CmdArgV[2]) + 1);
  2357.          }
  2358.       else
  2359.          {
  2360.          urgent = FALSE;
  2361.          point = strstr(KMS_LC->Session.InputBuffer, CmdArgV[1]);
  2362.          sprintf(buff, "OUT NOPARSE TEXT \r%s: %s", KMS_LC->Session.CurrentUser->UserData.Name, point + strlen(CmdArgV[1]) + 1);
  2363.          }
  2364.  
  2365.       if (!urgent && CmpArg(1, "*"))
  2366.          {
  2367.          if (SendPortMsg(buff, -1, CM_NORMAL))
  2368.             SysMsg(PORTMSG_SENT);
  2369.          else
  2370.             SysMsg(PORTMSG_FAILED);
  2371.          }
  2372.       else if (!urgent && atoi(CmdArgV[1]))
  2373.          {
  2374.          if (SendPortMsg(buff, atoi(CmdArgV[1]), CM_NORMAL))
  2375.             SysMsg(PORTMSG_SENT);
  2376.          else
  2377.             SysMsg(PORTMSG_FAILED);
  2378.          }
  2379.       else if (!urgent)
  2380.          {
  2381.          struct UserNode *upoint;
  2382.          if (upoint = UserCheck(CmdArgV[1]))
  2383.             {
  2384.             TakeMSem(FALSE);
  2385.  
  2386.             struct KMSNode *member = KMSBase->MemberList.mlh_Head;
  2387.             while(member->Node.mln_Succ)
  2388.                {
  2389.                if (member->LCPtr->Session.CurrentUser == upoint)
  2390.                   {
  2391.                   if (SendPortMsg(buff, member->LCPtr->ID, CM_NORMAL))
  2392.                      SysMsg(PORTMSG_SENT);
  2393.                   else
  2394.                      SysMsg(PORTMSG_FAILED);
  2395.                   }
  2396.                member = member->Node.mln_Succ;
  2397.                }
  2398.  
  2399.             DropMSem();
  2400.             }
  2401.          else
  2402.             SysMsg(USER_NOT_FOUND);
  2403.          }
  2404.       else if (CmpArg(2, "*"))
  2405.          {
  2406.          if (SendPortMsg(buff, -1, CM_URGENT))
  2407.             SysMsg(PORTMSG_SENT);
  2408.          else
  2409.             SysMsg(PORTMSG_FAILED);
  2410.          }
  2411.       else if (atoi(CmdArgV[2]))
  2412.          {
  2413.          if (SendPortMsg(buff, atoi(CmdArgV[2]), CM_URGENT))
  2414.             SysMsg(PORTMSG_SENT);
  2415.          else
  2416.             SysMsg(PORTMSG_FAILED);
  2417.          }
  2418.       else
  2419.          {
  2420.          struct UserNode *upoint;
  2421.          if (upoint = UserCheck(CmdArgV[2]))
  2422.             {
  2423.             TakeMSem(FALSE);
  2424.  
  2425.             struct KMSNode *member = KMSBase->MemberList.mlh_Head;
  2426.             while(member->Node.mln_Succ)
  2427.                {
  2428.                if (member->LCPtr->Session.CurrentUser == upoint)
  2429.                   {
  2430.                   if (SendPortMsg(buff, member->LCPtr->ID, CM_URGENT))
  2431.                      SysMsg(PORTMSG_SENT);
  2432.                   else
  2433.                      SysMsg(PORTMSG_FAILED);
  2434.                   }
  2435.                member = member->Node.mln_Succ;
  2436.                }
  2437.  
  2438.             DropMSem();
  2439.             }
  2440.          else
  2441.             SysMsg(USER_NOT_FOUND);
  2442.          }
  2443.       }
  2444.    }
  2445.  
  2446. ///
  2447.  
  2448. /***************************************
  2449.  * Befehl: REREAD                      *
  2450.  ***************************************
  2451.  * I: ---                              *
  2452.  * O: ---                              *
  2453.  ***************************************/
  2454.  
  2455. /// "Cmd_REREAD"
  2456.  
  2457. VOID Cmd_REREAD(VOID)
  2458.    {
  2459.    UMSMsgNum num;
  2460.    TEXT buff[LEN_NUMBER+1];
  2461.  
  2462.    if (CmdArgC == 1)
  2463.       {
  2464.       /* Aktuelle Msg wiedervorlegen */
  2465.  
  2466.       if (!Lastmsg)
  2467.          SysMsg(NO_MSG_READ);
  2468.       else
  2469.          {
  2470.          if (UMSSelectTags(MyUMSAccount, UMSTAG_SelMsg, Lastmsg,
  2471.                                          UMSTAG_SelWriteLocal, TRUE,
  2472.                                          UMSTAG_SelSet, KMSLSTATF_PostPoned,
  2473.                                          TAG_DONE))
  2474.             {
  2475.             strcpy(buff, "1");
  2476.             PPArg = buff;
  2477.             SysMsg(MSG_REREAD);
  2478.             PPArg = NULL;
  2479.             }
  2480.          else
  2481.             SysMsg(MSG_NOT_FOUND);
  2482.          }
  2483.       }
  2484.    else if (CmdArgC > 1)
  2485.       {
  2486.       /* Angegebenen Nummernbereich wiedervorlegen */
  2487.  
  2488.       if (ParseRange(CmdArgV[1]))
  2489.          {
  2490.          if (num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
  2491.                                          UMSTAG_SelMask, KMSLSTATF_InRange,
  2492.                                          UMSTAG_SelMatch, KMSLSTATF_InRange,
  2493.                                          UMSTAG_SelWriteLocal, TRUE,
  2494.                                          UMSTAG_SelSet, KMSLSTATF_PostPoned,
  2495.                                          TAG_DONE))
  2496.             {
  2497.             sprintf(buff, "%ld", num);
  2498.             PPArg = buff;
  2499.             SysMsg(MSG_REREAD);
  2500.             PPArg = NULL;
  2501.             }
  2502.          else
  2503.             SysMsg(MSG_NOT_FOUND);
  2504.          }
  2505.       else if (CmpArg(1, "*"))
  2506.          {
  2507.          if (num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
  2508.                                          UMSTAG_SelMask, KMSLSTATF_InGroup|KMSLSTATF_Unread,
  2509.                                          UMSTAG_SelMatch, KMSLSTATF_InGroup,
  2510.                                          UMSTAG_SelWriteLocal, TRUE,
  2511.                                          UMSTAG_SelSet, KMSLSTATF_PostPoned,
  2512.                                          TAG_DONE))
  2513.             {
  2514.             sprintf(buff, "%ld", num);
  2515.             PPArg = buff;
  2516.             SysMsg(MSG_REREAD);
  2517.             PPArg = NULL;
  2518.             }
  2519.          else
  2520.             SysMsg(NO_MSG_FOUND);
  2521.          }
  2522.       else if (CmpArg(1, "**"))
  2523.          {
  2524.          if (num = UMSSelectTags(MyUMSAccount, UMSTAG_SelReadLocal, TRUE,
  2525.                                          UMSTAG_SelMask, KMSLSTATF_Visible|KMSLSTATF_Unread,
  2526.                                          UMSTAG_SelMatch, KMSLSTATF_Visible,
  2527.                                          UMSTAG_SelWriteLocal, TRUE,
  2528.                                          UMSTAG_SelSet, KMSLSTATF_PostPoned,
  2529.                                          TAG_DONE))
  2530.             {
  2531.             sprintf(buff, "%ld", num);
  2532.             PPArg = buff;
  2533.             SysMsg(MSG_REREAD);
  2534.             PPArg = NULL;
  2535.             }
  2536.          else
  2537.             SysMsg(NO_MSG_FOUND);
  2538.          }
  2539.       else
  2540.          SysMsg(INVALID_PARAMS);
  2541.       }
  2542.    else
  2543.       SysMsg(TOO_MANY_PARAMS);
  2544.    }
  2545.  
  2546. ///
  2547.  
  2548. /***************************************
  2549.  * Befehl: BITED                       *
  2550.  ***************************************
  2551.  * I: ---                              *
  2552.  * O: ---                              *
  2553.  ***************************************/
  2554.  
  2555. /// "Cmd_BITED"
  2556.  
  2557. VOID Cmd_BITED(VOID)
  2558.    {
  2559.    if (CmdArgC == 1)
  2560.       EditBitNames();
  2561.    else if (CmdArgC == 2)
  2562.       {
  2563.       if (CmpArg(1, "?"))
  2564.          ListBitNames();
  2565.       else
  2566.          SysMsg(INVALID_PARAMS);
  2567.       }
  2568.    else
  2569.       SysMsg(TOO_MANY_PARAMS);
  2570.    }
  2571.  
  2572. ///
  2573.  
  2574. /***************************************
  2575.  * Befehl: UPLOAD                      *
  2576.  ***************************************
  2577.  * I: ---                              *
  2578.  * O: ---                              *
  2579.  ***************************************/
  2580.  
  2581. /// "Cmd_UPLOAD"
  2582.  
  2583. VOID Cmd_UPLOAD(VOID)
  2584.    {
  2585.    if (CmdArgC == 1)
  2586.       Upload(0);
  2587.    else if (CmdArgC == 2)
  2588.       SysMsg(INVALID_PARAMS);
  2589.    else if (CmdArgC == 3)
  2590.       {
  2591.       if (CmpArg(1, ">"))
  2592.          {
  2593.          /* Binärdatei umsetzen in anderes Brett */
  2594.  
  2595.          if (!Lastmsg)
  2596.             SysMsg(NO_MSG_READ);
  2597.          else
  2598.             {
  2599.             struct AreaNode *group;
  2600.  
  2601.             if (group=ChangeArea(CmdArgV[2]))
  2602.                {
  2603.                CreatePath(group);
  2604.  
  2605.                PPArg2 = PathString;
  2606.                if (YNRequest(QUERY_MOVE_BINARY, TRUE))
  2607.                   {
  2608.                   PPArg2 = NULL;
  2609.                   if (MoveBin(Lastmsg, group, FALSE))
  2610.                      DeleteMsg(NULL, DEL_CURRENT);
  2611.                   }
  2612.                PPArg2 = NULL;
  2613.                }
  2614.             else
  2615.                SysMsg(INVALID_PATH);
  2616.             }
  2617.          }
  2618.       else
  2619.          SysMsg(INVALID_PARAMS);
  2620.       }
  2621.    else
  2622.       SysMsg(TOO_MANY_PARAMS);
  2623.    }
  2624.  
  2625. ///
  2626.  
  2627. /***************************************
  2628.  * Befehl: DOWNLOAD                    *
  2629.  ***************************************
  2630.  * I: ---                              *
  2631.  * O: ---                              *
  2632.  ***************************************/
  2633.  
  2634. /// "Cmd_DOWNLOAD"
  2635.  
  2636. VOID Cmd_DOWNLOAD(VOID)
  2637.    {
  2638.    if (CmdArgC == 1) /* Aktuelle downloaden */
  2639.       Download(0, DOWN_XFER|DOWN_CURRENT, NULL);
  2640.    else if (CmdArgC == 2)
  2641.       {
  2642.       if (CmpArg(1, "?")) /* Liste aller selektierten */
  2643.          Download(0, DOWN_LIST|DOWN_SELECTED, NULL);
  2644.       else if (CmpArg(1, "&")) /* Aktuelle selektieren für Download */
  2645.          Download(0, DOWN_SELECT|DOWN_CURRENT, NULL);
  2646.       else if (CmpArg(1, "-")) /* Aktuelle deselektieren */
  2647.          Download(0, DOWN_DESELECT|DOWN_CURRENT, NULL);
  2648.       else if (CmpArg(1, "%")) /* Selektierte downloaden */
  2649.          Download(0, DOWN_XFER|DOWN_SELECTED, NULL);
  2650.       else if (ParseRange(CmdArgV[1]))
  2651.          Download(0, DOWN_XFER|DOWN_RANGE, NULL); /* Nummernrange downloaden */
  2652.       else
  2653.          SysMsg(INVALID_PARAMS);
  2654.       }
  2655.    else if (CmdArgC == 3)
  2656.       {
  2657.       if (ParseRange(CmdArgV[1]))
  2658.          {
  2659.          if (CmpArg(2, "&")) /* Nummer selektieren */
  2660.             Download(0, DOWN_SELECT|DOWN_RANGE, NULL);
  2661.          else if (CmpArg(2, "-")) /* Nummer deselektieren */
  2662.             Download(0, DOWN_DESELECT|DOWN_RANGE, NULL);
  2663.          else
  2664.             SysMsg(INVALID_PARAMS);
  2665.          }
  2666.       else
  2667.          SysMsg(INVALID_PARAMS);
  2668.       }
  2669.    else
  2670.       SysMsg(TOO_MANY_PARAMS);
  2671.    }
  2672.  
  2673. ///
  2674.  
  2675. /***************************************
  2676.  * Befehl: SCHREIBMODUS                *
  2677.  ***************************************
  2678.  * I: ---                              *
  2679.  * O: ---                              *
  2680.  ***************************************/
  2681.  
  2682. /// "Cmd_SCHREIBMODUS"
  2683.  
  2684. VOID Cmd_SCHREIBMODUS(VOID)
  2685.    {
  2686.    if (CmdArgC == 1)
  2687.       SysMsg(TOO_FEW_PARAMS);
  2688.    else if (CmdArgC == 2)
  2689.       {
  2690.       if (CmpArg(1, "+"))
  2691.          {
  2692.          KMS_LC->Session.CurrentUser->UserData.Flags |= UF_EXTSEND;
  2693.          SysMsg(EXTSEND_ENABLED);
  2694.          }
  2695.       else if (CmpArg(1, "-"))
  2696.          {
  2697.          KMS_LC->Session.CurrentUser->UserData.Flags &= ~UF_EXTSEND;
  2698.          SysMsg(EXTSEND_DISABLED);
  2699.          }
  2700.       else if (CmpArg(1, "?"))
  2701.          {
  2702.          if (KMS_LC->Session.CurrentUser->UserData.Flags & UF_EXTSEND)
  2703.             SysMsg(EXTSEND_ENABLED);
  2704.          else
  2705.             SysMsg(EXTSEND_DISABLED);
  2706.          }
  2707.       else
  2708.          SysMsg(INVALID_PARAMS);
  2709.       }
  2710.    else
  2711.       SysMsg(TOO_MANY_PARAMS);
  2712.    }
  2713.  
  2714. ///
  2715.  
  2716. /***************************************
  2717.  * Befehl: EXEC                        *
  2718.  ***************************************
  2719.  * I: ---                              *
  2720.  * O: ---                              *
  2721.  ***************************************/
  2722.  
  2723. /// "Cmd_EXEC"
  2724.  
  2725. VOID Cmd_EXEC(VOID)
  2726.    {
  2727.    TEXT outbuff[LEN_PARSEOUT+1];
  2728.    TEXT numbuff[LEN_NUMBER+1];
  2729.  
  2730.    if (CmdArgC == 1)
  2731.       SysMsg(TOO_FEW_PARAMS);
  2732.    else if (CmdArgC == 2)
  2733.       {
  2734.       sprintf(numbuff, "%d", KMS_LC->ID);
  2735.       PPArg = numbuff;
  2736.       StdStringParse(CmdArgV[1], outbuff, LEN_PARSEOUT);
  2737.       PPArg = NULL;
  2738.  
  2739.       SystemCall(outbuff);
  2740.       }
  2741.    else
  2742.       SysMsg(TOO_MANY_PARAMS);
  2743.    }
  2744.  
  2745. ///
  2746.  
  2747. /***************************************
  2748.  * Befehl: PAUSE                       *
  2749.  ***************************************
  2750.  * I: ---                              *
  2751.  * O: ---                              *
  2752.  ***************************************/
  2753.  
  2754. /// "Cmd_PAUSE"
  2755.  
  2756. VOID Cmd_PAUSE(VOID)
  2757.    {
  2758.    if (CmdArgC > 1)
  2759.       SysMsg(TOO_MANY_PARAMS);
  2760.    else
  2761.       ReturnRequest();
  2762.    }
  2763.  
  2764. ///
  2765.  
  2766. /***************************************
  2767.  * Befehl: CHAT                        *
  2768.  ***************************************
  2769.  * I: ---                              *
  2770.  * O: ---                              *
  2771.  ***************************************/
  2772.  
  2773. /// "Cmd_CHAT"
  2774.  
  2775. VOID Cmd_CHAT(VOID)
  2776.    {
  2777.    if (CmdArgC > 2)
  2778.       SysMsg(TOO_MANY_PARAMS);
  2779.    else if (CmdArgC == 2)
  2780.       ChitChat(CmdArgV[1]);
  2781.    else
  2782.       ChitChat(NULL);
  2783.    }
  2784.  
  2785. ///
  2786.  
  2787.